MythTV master
upnptasksearch.h
Go to the documentation of this file.
1
2// 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 LICENSE for details
10//
12#ifndef UPNPTASKSEARCH_H
13#define UPNPTASKSEARCH_H
14
15#include <chrono>
16using namespace std::chrono_literals;
17
18// Qt headers
19#include <QHostAddress>
20#include <QString>
21#include <QUdpSocket>
22
25
26class UPnpSearchTask : public Task
27{
28 protected:
30 std::chrono::seconds m_nMaxAge {1h};
31
32 QHostAddress m_peerAddress;
34 QString m_sST;
35 QString m_sUDN;
36
37 // Destructor protected to force use of Release Method
38 ~UPnpSearchTask() override = default;
39
40 void ProcessDevice(QUdpSocket& socket, const UPnpDevice& device);
41 void SendMsg(QUdpSocket& socket, const QString& sST, const QString& sUDN);
42
43 public:
44 UPnpSearchTask( int nServicePort,
45 const QHostAddress& peerAddress,
46 int nPeerPort,
47 QString sST,
48 QString sUDN );
49
50 QString Name() override { return "Search"; } // Task
51 void Execute( TaskQueue *pQueue ) override; // Task
52};
53
54#endif // UPNPTASKSEARCH_H
Definition: taskqueue.h:48
UPnpSearchTask(int nServicePort, const QHostAddress &peerAddress, int nPeerPort, QString sST, QString sUDN)
std::chrono::seconds m_nMaxAge
void Execute(TaskQueue *pQueue) override
void SendMsg(QUdpSocket &socket, const QString &sST, const QString &sUDN)
QHostAddress m_peerAddress
~UPnpSearchTask() override=default
void ProcessDevice(QUdpSocket &socket, const UPnpDevice &device)
QString Name() override