Host library for controlling a WiConnect enabled Wi-Fi module.

Dependents:   wiconnect-ota_example wiconnect-web_setup_example wiconnect-test-console wiconnect-tcp_server_example ... more

Revision:
26:8067e3d463d3
Parent:
20:7b67c3f94de9
--- a/types/Socket/internal/UDPSocket.cpp	Tue Aug 26 16:53:06 2014 -0700
+++ b/types/Socket/internal/UDPSocket.cpp	Thu Oct 23 15:16:06 2014 -0700
@@ -124,7 +124,17 @@
     }
     else
     {
-        return (socket.read(buffer, length, &bytesRead) == WICONNECT_SUCCESS) ? (int)bytesRead : -1;
+        for(;;)
+        {
+            if(socket.read(buffer, length, &bytesRead) != WICONNECT_SUCCESS)
+            {
+                return -1;
+            }
+            else if(bytesRead > 0)
+            {
+                return bytesRead;
+            }
+        }
     }
 
 }