modified for Doug Ansons ThermostatDemo: single change that turns off the debugging information by default.
Dependents: df-2013-thermostat-handson df-2013-minihack-thermostat-complete df-2013-minihack-thermostat df-2013-thermostat-remotes
Fork of WebSocketClient by
Revision 2:b390f29fb5fa, committed 2012-08-13
- Comitter:
- samux
- Date:
- Mon Aug 13 09:37:35 2012 +0000
- Parent:
- 1:de85cd4ec77b
- Child:
- 3:9589afa4712e
- Commit message:
- less timeout to read the first character received
Changed in this revision
Websocket.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/Websocket.cpp Mon Aug 13 09:21:41 2012 +0000 +++ b/Websocket.cpp Mon Aug 13 09:37:35 2012 +0000 @@ -83,8 +83,6 @@ printf("Could not send request"); return false; } - - while(socket.receive(cmd, 1) != 1); ret = read(cmd, 200); if(ret < 0) @@ -185,9 +183,13 @@ return false; } + socket.set_blocking(false, 1); if (socket.receive(&opcode, 1) != 1) { + socket.set_blocking(false, 2000); return false; } + + socket.set_blocking(false, 2000); if (opcode == 0x81) break;