OK connect Eth View: http://sockets.mbed.org/demo/viewer

Dependencies:   EthernetInterface WebSocketClient mbed-rtos mbed

Fork of Websocket_Ethernet_HelloWorld by Samuel Mokrani

Revision:
3:9dd9b7afa272
Parent:
1:1c1802ec42a2
--- a/main.cpp	Thu Aug 23 14:11:49 2012 +0000
+++ b/main.cpp	Sun Apr 27 06:58:33 2014 +0000
@@ -4,18 +4,22 @@
  
  
 int main() {
-    char recv[30];
+    char    recv[30];
+    int     ret;
  
     EthernetInterface eth;
     eth.init(); //Use DHCP
     eth.connect();
     printf("IP Address is %s\n\r", eth.getIPAddress());
  
-    Websocket ws("ws://sockets.mbed.org:443/ws/demo/wo");
+    Websocket ws("ws://sockets.mbed.org:443/ws/demo/rw");
     ws.connect();
  
     while (1) {
-        ws.send("WebSocket Hello World over Ethernet");
+        ret = ws.send("WebSocket Hello World over Ethernet");
+        printf("ret = %d\n", ret);
+        if (ws.read(recv)) 
+            printf("recv: %s\r\n", recv);
         wait(1.0);
     }
 }
\ No newline at end of file