Go to the documentation of this file.
25 #include "msocketdevice.h"
29 static constexpr
const char*
SSDP_GROUP {
"239.255.255.250" };
69 QRegularExpression m_procReqLineExp {
"\\s+"};
70 constexpr
static int kNumberOfSockets = 3;
71 std::array<MSocketDevice*,kNumberOfSockets> m_sockets {
nullptr,
nullptr,
nullptr};
75 int m_nServicePort {0};
78 bool m_bAnnouncementsEnabled {
false};
80 bool m_bTermRequested {
false};
93 bool ProcessSearchRequest (
const QStringMap &sHeaders,
94 const QHostAddress& peerAddress,
95 quint16 peerPort )
const;
96 static bool ProcessSearchResponse(
const QStringMap &sHeaders );
97 static bool ProcessNotify (
const QStringMap &sHeaders );
99 bool IsTermRequested ();
103 const QString &sDefault );
105 void ProcessData ( MSocketDevice *pSocket );
113 static SSDP* Instance();
114 static void Shutdown();
118 void RequestTerminate(
void);
120 void PerformSearch(
const QString &sST, std::chrono::seconds
timeout = 2s);
122 void EnableNotifications (
int nServicePort );
123 void DisableNotifications();
QStringList GetBasePaths() override
static SSDPCacheEntries * Find(const QString &sURI)
static SSDPCache * Instance()
static DeviceLocation * Find(const QString &sURI, const QString &sUSN)
void addListener(QObject *listener)
Add a listener to the observable.
static SSDPMethod GetMethod(const QString &sURI)
SSDPCacheEntries * Find(const QString &sURI)
Finds the SSDPCacheEntries in the cache, returns nullptr when absent.
QMap< QString, QString > QStringMap
~SSDPExtension() override=default
static constexpr uint16_t SSDP_SEARCHPORT
bool ProcessRequest(HTTPRequest *pRequest) override
virtual void run(void)
Runs the Qt event loop unless we have a QRunnable, in which case we run the runnable run instead.
static void GetDeviceList(HTTPRequest *pRequest)
void GetDeviceDesc(HTTPRequest *pRequest) const
This is a wrapper around QThread that does several additional things.
static void AddListener(QObject *listener)
static constexpr const char * SSDP_GROUP
SSDPExtension(int nServicePort, const QString &sSharePath)
void removeListener(QObject *listener)
Remove a listener to the observable.
void GetFile(HTTPRequest *pRequest, const QString &sFileName)
static void RemoveListener(QObject *listener)
static constexpr uint16_t SSDP_PORT