A fork of the original interface for OS/2. Features a correctly-implemented recv (but retains the old behavior via recv2).
Dependents: weather_clock weather_clock
Diff: Socket/TCPSocketConnection.cpp
- Revision:
- 48:6031f70e3914
- Parent:
- 44:16da10e7b3f7
- Child:
- 49:cac09a34102c
diff -r 04632d22a723 -r 6031f70e3914 Socket/TCPSocketConnection.cpp --- 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) {