Websocket client test with Vodafone USB Modems
Dependencies: WebSocketClient VodafoneUSBModem mbed mbed-rtos
Fork of VodafoneK3770WebsocketTestBeta by
Revision 4:0f0cd888156b, committed 2012-08-29
- Comitter:
- donatien
- Date:
- Wed Aug 29 14:01:05 2012 +0000
- Parent:
- 3:94eaeed5d787
- Child:
- 5:f46c9de3885a
- Commit message:
- Updated Websocket library & example code
Changed in this revision
WebSocketClient.lib | Show annotated file Show diff for this revision Revisions of this file |
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/WebSocketClient.lib Fri Aug 17 16:19:10 2012 +0000 +++ b/WebSocketClient.lib Wed Aug 29 14:01:05 2012 +0000 @@ -1,1 +1,1 @@ -http://mbed.org/users/samux/code/WebSocketClient/#9589afa4712e +http://mbed.org/users/samux/code/WebSocketClient/#bb09d7a6c92f
--- a/main.cpp Fri Aug 17 16:19:10 2012 +0000 +++ b/main.cpp Wed Aug 29 14:01:05 2012 +0000 @@ -15,18 +15,27 @@ return; } - ws.connect(); - - for(int i = 0; i < 500; i++) + bool c = ws.connect(); + printf("Connect result: %s\n", c?"OK":"Failed"); + + for(int i = 0; i < 10000; i++) { if(!(i%100)) - ws.send("WebSocket Hello World over the Vodafone Network!"); - + { + int ret = ws.send("WebSocket Hello World over the Vodafone Network!"); + if(ret<0) + { + printf("Timeout\n"); + ws.close(); + c = ws.connect(); + printf("Connect result: %s\n", c?"OK":"Failed"); + } + } + if (ws.read(recv)) { printf("rcv: %s\r\n", recv); } - - Thread::wait(10); + } modem.disconnect();