For bug fixes
Fork of MTS-Socket by
Diff: TCPSocketConnection.cpp
- Revision:
- 44:00927cf819d5
- Parent:
- 22:966373d2930c
--- 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; } }