MythTV master
mythudplistener.h
Go to the documentation of this file.
1#ifndef MYTHUDPLISTENER_H
2#define MYTHUDPLISTENER_H
3
4// Qt
5#include <QObject>
6
7// MythTV
10
11class MythUDPListener : public QObject
12{
13 friend class MythUDP;
14
15 Q_OBJECT
16
17 signals:
18 void EnableUDPListener(bool Enable = true);
19
20 protected:
22 ~MythUDPListener() override;
23
24 private slots:
25 void DoEnable(bool Enable = true);
26 static void Process(const QByteArray &Buffer, const QHostAddress& /*Sender*/, quint16 /*SenderPort*/);
27
28 private:
29 Q_DISABLE_COPY(MythUDPListener)
31};
32
34{
35 public:
36 static void EnableUDPListener(bool Enable = true);
37 static void StopUDPListener();
38
39 private:
40 Q_DISABLE_COPY(MythUDP)
41 static MythUDP& Instance();
42 MythUDP();
43 ~MythUDP();
44
46 MThread* m_thread { nullptr };
47};
48
49#endif
This is a wrapper around QThread that does several additional things.
Definition: mthread.h:49
void DoEnable(bool Enable=true)
static void Process(const QByteArray &Buffer, const QHostAddress &, quint16)
ServerPool * m_socketPool
void EnableUDPListener(bool Enable=true)
~MythUDPListener() override
MThread * m_thread
static MythUDP & Instance()
MythUDPListener * m_listener
static void EnableUDPListener(bool Enable=true)
static void StopUDPListener()
Manages a collection of sockets listening on different ports.
Definition: serverpool.h:60