Simple HTTP server example with WIZ550io, W5500 (WIZnet chipset) .access the mbed via any browser, mbed echo back http request header.

Dependencies:   W5500Interface mbed

Fork of HTTPServer_echoback_WIZ550io by Bongjun Hur

Revision:
17:c42419afb2f8
Parent:
16:ea8f49af2d86
Child:
18:bed64c7e5a72
--- a/main.cpp	Mon Jul 21 05:13:27 2014 +0000
+++ b/main.cpp	Mon Jul 21 05:18:06 2014 +0000
@@ -6,11 +6,14 @@
 
 #define PORT   80
 
+// move to main().
 //EthernetInterface eth;
 
+// move to main().
 //TCPSocketServer svr;
 bool serverIsListened = false;
 
+// move to main().
 //TCPSocketConnection client;
 bool clientIsConnected = false;
 DigitalOut led1(LED1); //server listning status
@@ -48,17 +51,18 @@
 
 #endif
 
-TCPSocketServer svr;
-TCPSocketConnection client;
+    // late binding 
+    TCPSocketServer svr;
+    TCPSocketConnection client;
 
     ledTick.attach(&ledTickfunc,0.5);
 
-/*
-    //setup ethernet interface
-    eth.init(); //Use DHCP
-    eth.connect();
-    printf("IP Address is %s\n\r", eth.getIPAddress());
-*/
+    /*
+        //setup ethernet interface
+        eth.init(); //Use DHCP
+        eth.connect();
+        printf("IP Address is %s\n\r", eth.getIPAddress());
+    */
 
 #ifdef _DHCP // didn't test yet in DHCP
 
@@ -107,7 +111,7 @@
             printf("connection success!\n\rIP: %s\n\r",client.get_address());
             clientIsConnected = true;
             led2 = true;
-            
+
             while(clientIsConnected) {
                 char buffer[1024] = {};
                 switch(client.receive(buffer, 1023)) {