Details
-
Improvement
-
Status: Closed
-
Major
-
Resolution: Duplicate
-
current (nightly)
-
None
Description
It would appear we current use blocking receive in the transport. Most of the time this isn't a problem.
However, in the case where a server stops responding (as has been seen with recent problems in the MockServer) the client becomes "stuck" waiting for data that will never arrive.
I, therefore, propose we use the receive in non-blocking mode.
The linux man pages have the following to say about using recv:
"If no messages are available at the socket, the receive calls wait for
a message to arrive, unless the socket is nonblocking (see fcntl(2)) in
which case the value -1 is returned and the external variable errno set
to EAGAIN. The receive calls normally return any data available, up to
the requested amount, rather than waiting for receipt of the full
amount requested.
The select(2) or poll(2) call may be used to determine when more data
arrives."
Which suggests to me we could be a little more intelligent in how receive data.