On Tue, 27 Sep 2011 10:53:13 +0100, Regan Heath <[email protected]> wrote:
.. call recv, if != 0; check for WSAEWOULDBLOCK/EWOULDBLOCK, call select, loop until recv returns 0 ..

In this loop you will also need to check for WSAECONNRESET/ECONNRESET to detect a badly behaved remote end calling close without shutdown/recv itself. You can either chose to swallow/ignore this error, or to log/trace it, whatever is suitable to your application. I would not recommend throwing an exception or treating it like a failure .. unless you control the code on both ends of the connection as it might indicate a bug in your code.

--
Using Opera's revolutionary email client: http://www.opera.com/mail/

Reply via email to