Doug Anson / SocketIO

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

Files at this revision

API Documentation at this revision

Comitter:
ansond
Date:
Mon Jul 08 04:15:03 2013 +0000
Parent:
8:6948173ffe81
Child:
10:997b8c5d2d46
Commit message:
reading fixes

Changed in this revision

SocketIO.cpp Show annotated file Show diff for this revision Revisions of this file
--- 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;