Simple TCP/IP Server (static web page_

Files at this revision

API Documentation at this revision

Comitter:
noutram
Date:
Fri Nov 08 14:19:22 2019 +0000
Parent:
1:fadd0e3db646
Child:
3:c62ab6a06986
Commit message:
Updated for 2019

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed-os.lib Show annotated file Show diff for this revision Revisions of this file
--- a/main.cpp	Thu Nov 23 14:16:06 2017 +0000
+++ b/main.cpp	Fri Nov 08 14:19:22 2019 +0000
@@ -1,7 +1,3 @@
-#if !FEATURE_LWIP
-    #error [NOT_SUPPORTED] LWIP not supported for this target
-#endif
-
 #include "mbed.h"
 #include "EthernetInterface.h"
 #include "TCPServer.h"
@@ -40,7 +36,7 @@
     printf("The target IP address is '%s'\n", eth.get_ip_address());
     
     //Now setup a web server
-    TCPServer srv;           //TCP/IP Server
+    TCPSocket srv;           //TCP/IP Server
     TCPSocket clt_sock;      //Socket for communication
     SocketAddress clt_addr;  //Address of incoming connection
     
@@ -55,7 +51,7 @@
     
     while (true) {
         //Block and wait on an incoming connection
-        srv.accept(&clt_sock, &clt_addr);
+        srv.accept();
         printf("accept %s:%d\n", clt_addr.get_ip_address(), clt_addr.get_port());
         
         //Send static HTML response
--- a/mbed-os.lib	Thu Nov 23 14:16:06 2017 +0000
+++ b/mbed-os.lib	Fri Nov 08 14:19:22 2019 +0000
@@ -1,1 +1,1 @@
-https://github.com/ARMmbed/mbed-os/#34b61d1612aaec2e5d61a8a43c9764bc2fe8aac0
+https://github.com/ARMmbed/mbed-os/#3a57ec7401a77b8b98f6356a1498cb154229483f