Simple TCP/IP Server (dynamic web page)

Dependents:   TASKHTML

Files at this revision

API Documentation at this revision

Comitter:
noutram
Date:
Fri Nov 08 14:22:35 2019 +0000
Parent:
1:76bd6f78cabc
Child:
3:265121e8c2cc
Commit message:
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	Tue Nov 21 14:21:48 2017 +0000
+++ b/main.cpp	Fri Nov 08 14:22:35 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"
@@ -47,7 +43,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
     
@@ -63,7 +59,7 @@
     while (true) {
         using namespace std;
         //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());
         
         //Uses a C++ string to make it easier to concatinate
--- a/mbed-os.lib	Tue Nov 21 14:21:48 2017 +0000
+++ b/mbed-os.lib	Fri Nov 08 14:22:35 2019 +0000
@@ -1,1 +1,1 @@
-https://github.com/ARMmbed/mbed-os/#78474a5129e18e136cc7e872adbaa5b74fbb8f6a
+https://github.com/ARMmbed/mbed-os/#3a57ec7401a77b8b98f6356a1498cb154229483f