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  ~UPnpSearchTask() override = 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 *pQueue ) override; // Task
75 
76 };
77 
78 
79 #endif // UPNPTASKSEARCH_H
UPnpSearchTask::m_nServicePort
int m_nServicePort
Definition: upnptasksearch.h:45
UPnpSearchTask
Definition: upnptasksearch.h:40
UPnpSearchTask::m_nMaxAge
int m_nMaxAge
Definition: upnptasksearch.h:46
UPnpSearchTask::SendMsg
void SendMsg(MSocketDevice *pSocket, const QString &sST, const QString &sUDN)
Definition: upnptasksearch.cpp:63
UPnpSearchTask::m_peerAddress
QHostAddress m_peerAddress
Definition: upnptasksearch.h:48
UPnpSearchTask::m_sST
QString m_sST
Definition: upnptasksearch.h:50
UPnpSearchTask::Execute
void Execute(TaskQueue *pQueue) override
Definition: upnptasksearch.cpp:146
TaskQueue
Definition: taskqueue.h:81
UPnpSearchTask::UPnpSearchTask
UPnpSearchTask(int nServicePort, QHostAddress peerAddress, int nPeerPort, QString sST, QString sUDN)
Definition: upnptasksearch.cpp:43
UPnpSearchTask::m_nPeerPort
int m_nPeerPort
Definition: upnptasksearch.h:49
upnp.h
compat.h
Task
Definition: taskqueue.h:53
UPnpSearchTask::ProcessDevice
void ProcessDevice(MSocketDevice *pSocket, UPnpDevice *pDevice)
Definition: upnptasksearch.cpp:186
UPnpDevice
Definition: upnpdevice.h:99
UPnpSearchTask::Name
QString Name() override
Definition: upnptasksearch.h:73
UPnpSearchTask::m_addressList
QList< QHostAddress > m_addressList
Definition: upnptasksearch.h:44
UPnpSearchTask::~UPnpSearchTask
~UPnpSearchTask() override=default
UPnpSearchTask::m_sUDN
QString m_sUDN
Definition: upnptasksearch.h:51