ap

Dependencies:   DnsQuery

Dependents:   WizFi310_TCP_Echo_Server_Example

Fork of NetworkSocketAPI by NetworkSocketAPI

Revision:
117:ff83eb6a1ab9
Parent:
116:bc043343d753
Child:
118:96627c4b83d5
--- a/TCPSocket.cpp	Wed Apr 20 19:20:51 2016 -0500
+++ b/TCPSocket.cpp	Wed Apr 20 19:48:17 2016 -0500
@@ -62,8 +62,7 @@
 
         int sent = _iface->socket_send(_socket, data, size);
         if (sent != NSAPI_ERROR_WOULD_BLOCK
-            || _timeout < 0
-            || timer.read_ms() > _timeout) {
+            || (_timeout >= 0 && timer.read_ms() > _timeout)) {
             return sent;
         }
 
@@ -83,8 +82,7 @@
     
         int recv = _iface->socket_recv(_socket, data, size);
         if (recv != NSAPI_ERROR_WOULD_BLOCK
-            || _timeout < 0
-            || timer.read_ms() > _timeout) {
+            || (_timeout >= 0 && timer.read_ms() > _timeout)) {
             return recv;
         }