A simple web server that can be bound to either the EthernetInterface or the WiflyInterface.

Dependents:   Smart-WiFly-WebServer WattEye X10Svr SSDP_Server

Files at this revision

API Documentation at this revision

Comitter:
WiredHome
Date:
Tue Jul 10 03:06:32 2018 +0000
Parent:
55:238dd90b6fb3
Child:
57:fb81057b4d77
Commit message:
Change socket i/f to blocking

Changed in this revision

SW_HTTPServer.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/SW_HTTPServer.cpp	Mon Jul 02 17:31:05 2018 +0000
+++ b/SW_HTTPServer.cpp	Tue Jul 10 03:06:32 2018 +0000
@@ -12,7 +12,7 @@
 //
 #include "mbed.h"
 
-//#define DEBUG "HTTP"
+#define DEBUG "HTTP"
 #include <cstdio>
 #if (defined(DEBUG) && !defined(TARGET_LPC11U24))
 #define DBG(x, ...)  std::printf("[DBG %s %3d] "x"\r\n", DEBUG, __LINE__, ##__VA_ARGS__);
@@ -152,8 +152,8 @@
     server = new TCPSocketServer();
     server->bind(port);
     server->listen(5);
-    server->set_blocking(false, blockingtime);
-    client.set_blocking(false,  blockingtime);  //@TODO client is separate from server. any way to combine?
+    server->set_blocking(true, blockingtime);
+    client.set_blocking(true,  blockingtime);  //@TODO client is separate from server. any way to combine?
     ResetPerformanceData();
     PerformanceTimer.start();
 }