NetworkSocketAPI

Dependencies:   DnsQuery

Dependents:   HelloWizFi250Interface

Fork of NetworkSocketAPI by NetworkSocketAPI

Revision:
118:96627c4b83d5
Parent:
117:ff83eb6a1ab9
Child:
119:4f8b720d512a
--- a/TCPServer.cpp	Wed Apr 20 19:48:17 2016 -0500
+++ b/TCPServer.cpp	Wed Apr 20 20:38:00 2016 -0500
@@ -44,6 +44,10 @@
 {
     mbed::Timer timer;
     timer.start();
+    mbed::Timeout timeout;
+    if (_timeout >= 0) {
+        timeout.attach_us(&Socket::wakeup, _timeout * 1000);
+    }
 
     if (connection->_socket) {
         connection->close();
@@ -61,7 +65,7 @@
         }
 
         if (err != NSAPI_ERROR_WOULD_BLOCK
-            || (_timeout >= 0 && timer.read_ms() > _timeout)) {
+            || (_timeout >= 0 && timer.read_ms() >= _timeout)) {
             return err;
         }