Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of MTS-Socket by
Revision 44:00927cf819d5, committed 2017-05-12
- 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; } }