00001 00002 // Program Name: upnptasksearch.h 00003 // Created : Oct. 24, 2005 00004 // 00005 // Purpose : UPnp Task to handle Discovery Responses 00006 // 00007 // Copyright (c) 2005 David Blain <dblain@mythtv.org> 00008 // 00009 // Licensed under the GPL v2 or later, see COPYING for details 00010 // 00012 00013 #ifndef __UPNPTASKSEARCH_H__ 00014 #define __UPNPTASKSEARCH_H__ 00015 00016 // POSIX headers 00017 #include <sys/types.h> 00018 #ifndef USING_MINGW 00019 #include <netinet/in.h> 00020 #include <arpa/inet.h> 00021 #endif 00022 00023 // Qt headers 00024 #include <QStringList> 00025 #include <QHostAddress> 00026 00027 // MythTV headers 00028 #include "upnp.h" 00029 #include "msocketdevice.h" 00030 #include "compat.h" 00031 00034 // 00035 // UPnpSearchTask Class Definition 00036 // 00039 00040 class UPnpSearchTask : public Task 00041 { 00042 protected: 00043 00044 QStringList m_addressList; 00045 int m_nServicePort; 00046 int m_nMaxAge; 00047 00048 QHostAddress m_PeerAddress; 00049 int m_nPeerPort; 00050 QString m_sST; 00051 QString m_sUDN; 00052 00053 00054 protected: 00055 00056 // Destructor protected to force use of Release Method 00057 00058 virtual ~UPnpSearchTask(); 00059 00060 void ProcessDevice ( MSocketDevice *pSocket, UPnpDevice *pDevice ); 00061 void SendMsg ( MSocketDevice *pSocket, 00062 QString sST, 00063 QString sUDN ); 00064 00065 public: 00066 00067 UPnpSearchTask( int nServicePort, 00068 QHostAddress peerAddress, 00069 int nPeerPort, 00070 QString sST, 00071 QString sUDN ); 00072 00073 virtual QString Name () { return( "Search" ); } 00074 virtual void Execute( TaskQueue * ); 00075 00076 }; 00077 00078 00079 #endif
1.6.3