Single instance HTTP Server using new Ethernet Interface. Blocking mode only; this improved stability, but the HTTP server must be started from a separate thread.

Dependents:   SmartLight

Fork of HTTPServer by Henry Leinen

Revision:
6:fe661fa9d18a
Parent:
5:dc88012caef1
Child:
9:c2a1462b9b71
--- a/HTTPServer.cpp	Sat Jun 01 06:24:43 2013 +0000
+++ b/HTTPServer.cpp	Sat Jun 01 16:49:17 2013 +0000
@@ -1,7 +1,7 @@
 #include "mbed.h"
 #include "HTTPServer.h"
 
-#define _DEBUG      1
+#define _DEBUG      0
 
 #ifdef _DEBUG
 DigitalOut led1(LED1);
@@ -89,7 +89,7 @@
 }
 
 
-int HTTPServer::poll()
+int HTTPServer::poll(bool blocking)
 {    
     int retval = -1;
     INFO("Listening for new connection requests.");
@@ -101,7 +101,7 @@
 #ifdef _DEBUG
     led4 = 1;   //  Indicate we are waiting for a new connection 
 #endif
-    m_pSvr->set_blocking(true); 
+    m_pSvr->set_blocking(blocking); 
     retval = m_pSvr->accept(Clnt);
     if (retval > 0) {
         // no connection availale yet, so just return