now this shit works

Dependencies:   BufferedSerial

Dependents:   IoTWeatherStation

Fork of ESP8266NodeMCUInterface by ESP8266

Revision:
48:6031f70e3914
Parent:
44:16da10e7b3f7
--- a/Socket/TCPSocketConnection.cpp	Thu Jun 04 20:18:39 2015 +0000
+++ b/Socket/TCPSocketConnection.cpp	Thu Jun 04 20:45:00 2015 +0000
@@ -131,6 +131,17 @@
         ERR("TCPSocketConnection::receive() - _is_connected is false : you cant receive data untill you connect to a socket!");
         return -1;
     }
+    
+    while (wifi->readable() < length)
+        ;
+        
+    if (!wifi->recv(buffer, &length))
+        return -1;
+        
+    return length;
+    
+    
+    /*
     Timer tmr;
     int idx = 0;
     int nb_available = 0;
@@ -196,7 +207,7 @@
     }
     //---
     return (idx == 0) ? -1 : idx;
-
+*/
 //************************ original code below
 //
 //    if (!_blocking) {