SocketIO is a compatibility library on top of the MBED Websockets API. Currently the broadcast paradigm is supported. There is much more to the SocketIO spec that could be built into this API. Have fun!

Dependents:   df-2013-thermostat-handson df-2013-minihack-thermostat-complete df-2013-minihack-thermostat df-2013-thermostat-remotes ... more

Revision:
9:4f02450a402a
Parent:
8:6948173ffe81
Child:
11:b32005b69b5c
--- a/SocketIO.cpp	Mon Jul 08 04:04:11 2013 +0000
+++ b/SocketIO.cpp	Mon Jul 08 04:15:03 2013 +0000
@@ -71,10 +71,10 @@
         char *json = this->prepareSocketIOJSONMessage(name,args,buffer);
         
         // send a heartbeat
-        this->ws->send("2:::");
+        bytesSent = this->ws->send("2::");
         
         // send the message
-        bytesSent = this->ws->send(json);
+        if (bytesSent > 0) bytesSent = this->ws->send(json);
     }
     
     return bytesSent;