ap

Dependencies:   DnsQuery

Dependents:   WizFi310_TCP_Echo_Server_Example

Fork of NetworkSocketAPI by NetworkSocketAPI

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