SNICInterface for ThingPlug Example

Dependents:   ThingPlug_WiFi_Example ThingPlug_WiFi_Example_2

Fork of SNICInterface by muRata

Revision:
50:cd632a13e4dc
Parent:
43:d80bbb12ffe6
--- a/Socket/UDPSocket.cpp	Tue Mar 31 02:50:55 2015 +0000
+++ b/Socket/UDPSocket.cpp	Tue Mar 31 02:53:44 2015 +0000
@@ -303,9 +303,17 @@
     con_info_p->mutex.lock();
     con_info_p->is_receive_complete = true;
     con_info_p->mutex.unlock();
-    while( con_info_p->is_received == false )
+    if( con_info_p->is_received == false )
     {
+        // Try receive
         Thread::yield();
+        
+        if( con_info_p->is_received == false )
+        {
+            // No data received.
+            FUNC_OUT();
+            return 0;
+        }
     }
     // Get packet data from buffer for receive.
     int i;