MythTV  master
bonjourregister.h
Go to the documentation of this file.
1 #ifndef BONJOURREGISTER_H
2 #define BONJOURREGISTER_H
3 
4 #include <QObject>
5 #include <QMutex>
6 #include <dns_sd.h>
7 #include "mythbaseexp.h"
8 
9 class QSocketNotifier;
10 
11 class MBASE_PUBLIC BonjourRegister : public QObject
12 {
13  Q_OBJECT
14  public:
15  explicit BonjourRegister(QObject *parent = nullptr);
16  virtual ~BonjourRegister();
17 
18  bool Register(uint16_t port, const QByteArray &type, const QByteArray &name,
19  const QByteArray &txt);
20  bool ReAnnounceService(void);
21 
22  QByteArray m_name;
23  QByteArray m_type;
24 
25  private slots:
26  void socketReadyRead();
27 
28  private:
29  static void DNSSD_API BonjourCallback(DNSServiceRef ref,
30  DNSServiceFlags flags,
31  DNSServiceErrorType errorcode,
32  const char *name, const char *type,
33  const char *domain, void *object);
34  QByteArray RandomizeData(void);
35 
36  DNSServiceRef m_dnssref {nullptr};
37  QSocketNotifier *m_socket {nullptr};
38  QMutexLocker *m_lock {nullptr};
39  static QMutex g_lock;
40  QByteArray m_data;
41 };
42 #endif
unsigned int slots[4]
Definition: element.c:38
#define MBASE_PUBLIC
Definition: mythbaseexp.h:15
QByteArray m_type
QByteArray m_name
unsigned short uint16_t
Definition: iso6937tables.h:1
const char * name
Definition: ParseText.cpp:328
static QMutex g_lock
QByteArray m_data