For bug fixes

Dependencies:   HTTPClient-SSL

Dependents:   mtsas

Fork of MTS-Socket by MultiTech

Files at this revision

API Documentation at this revision

Comitter:
miaotwilio
Date:
Fri May 12 11:33:55 2017 +0000
Parent:
43:2b78cadc0894
Commit message:
nonblocking tcp receive should use timer.read_ms instead of timer.read

Changed in this revision

TCPSocketConnection.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/TCPSocketConnection.cpp	Thu Jun 25 13:56:41 2015 +0000
+++ b/TCPSocketConnection.cpp	Fri May 12 11:33:55 2017 +0000
@@ -59,6 +59,7 @@
 {
     Timer tmr;
     int bytes = 0;
+    
     int totalbytes = 0;
 
     if (_blocking) {
@@ -66,12 +67,12 @@
     } else {
         tmr.start();
         do {
-            bytes = ip->read(data + totalbytes, length - totalbytes, 250);
+            bytes = ip->read(data + totalbytes, length - totalbytes, 50);
             if (bytes < 0) {
                 return -1;
             }
             totalbytes += bytes;
-        } while ( tmr.read() < _timeout && totalbytes < length);
+        } while ( tmr.read_ms() < _timeout && totalbytes < length);
         return totalbytes;
     }
 }