MythTV  master
upnptasksearch.h
Go to the documentation of this file.
1 // Program Name: upnptasksearch.h
3 // Created : Oct. 24, 2005
4 //
5 // Purpose : UPnp Task to handle Discovery Responses
6 //
7 // Copyright (c) 2005 David Blain <dblain@mythtv.org>
8 //
9 // Licensed under the GPL v2 or later, see COPYING for details
10 //
12 
13 #ifndef __UPNPTASKSEARCH_H__
14 #define __UPNPTASKSEARCH_H__
15 
16 // POSIX headers
17 #include <sys/types.h>
18 #ifndef _WIN32
19 #include <netinet/in.h>
20 #include <arpa/inet.h>
21 #endif
22 
23 // Qt headers
24 #include <QList>
25 #include <QHostAddress>
26 
27 // MythTV headers
28 #include "upnp.h"
29 #include "msocketdevice.h"
30 #include "compat.h"
31 
34 //
35 // UPnpSearchTask Class Definition
36 //
39 
40 class UPnpSearchTask : public Task
41 {
42  protected:
43 
44  QList<QHostAddress> m_addressList;
46  int m_nMaxAge {3600};
47 
48  QHostAddress m_PeerAddress;
50  QString m_sST;
51  QString m_sUDN;
52 
53 
54  protected:
55 
56  // Destructor protected to force use of Release Method
57 
58  virtual ~UPnpSearchTask() = default;
59 
60  void ProcessDevice ( MSocketDevice *pSocket, UPnpDevice *pDevice );
61  void SendMsg ( MSocketDevice *pSocket,
62  const QString& sST,
63  const QString& sUDN );
64 
65  public:
66 
67  UPnpSearchTask( int nServicePort,
68  QHostAddress peerAddress,
69  int nPeerPort,
70  QString sST,
71  QString sUDN );
72 
73  QString Name() override { return( "Search" ); } // Task
74  void Execute( TaskQueue * ) override; // Task
75 
76 };
77 
78 
79 #endif
QString Name() override
QHostAddress m_PeerAddress
QList< QHostAddress > m_addressList
void ProcessDevice(MSocketDevice *pSocket, UPnpDevice *pDevice)
virtual ~UPnpSearchTask()=default
void Execute(TaskQueue *) override
void SendMsg(MSocketDevice *pSocket, const QString &sST, const QString &sUDN)
UPnpSearchTask(int nServicePort, QHostAddress peerAddress, int nPeerPort, QString sST, QString sUDN)
Definition: taskqueue.h:53