SSDP Server - working version provides SSDP based network discovery, and with a companion web server, may provide other functionalities.

Dependents:   X10Svr SSDP_Server

Files at this revision

API Documentation at this revision

Comitter:
WiredHome
Date:
Sat Jul 18 18:44:08 2020 +0000
Parent:
12:4e7c5e1fd32b
Child:
14:ad92261497ca
Commit message:
Debug enhancements

Changed in this revision

SSDP.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/SSDP.cpp	Sun Jan 12 19:01:30 2020 +0000
+++ b/SSDP.cpp	Sat Jul 18 18:44:08 2020 +0000
@@ -81,9 +81,10 @@
     SSDP_Config_T * cfg = (SSDP_Config_T *)args;
     
     server.bind(MCAST_PORT);
-    if (server.join_multicast_group(MCAST_GRP) != 0) {
-        ERR("Error joining the multicast group");
-        while (true) {}
+    int r = server.join_multicast_group(MCAST_GRP);
+    if (r != 0) {
+        ERR("Error joining the multicast group, ret: %d", r);
+        return;
     }
     server.set_blocking(false, 50); // non-blocking with 50ms timeout
     Endpoint client;
@@ -180,8 +181,9 @@
 }
 
 SSDP::~SSDP() {
+    INFO("Terminate SSDP object, pThr: %p", pThr);
     if (pThr)
-        pThr->terminate();
+        pThr->terminate();  // should terminate SSDPListener
     pThr = NULL;
     DelFriendlyName();
     DelIdentity();
@@ -269,6 +271,7 @@
 
 void SSDP::StartListener() {
     pThr = new Thread(SSDPListener, (void *)&_config, osPriorityLow, 768);
+    INFO("SSDP Listener Started: %p", pThr);
 }