[Asio] read_some throws exception with IOCP disabled

I have a piece of code that works completely fine with IOCP enabled, but when I disable it via the BOOST_ASIO_DISABLE_IOCP define, any attempts to call socket.read_some will throw an exception. This exception states that "An operation was attempted on something that is not a socket." However, I am able to write to this socket without problems; no exception is thrown and the data is received by the server. I've also tried reading and writing with the native Windows socket. Any calls to send() will succeed, but calls to recv() will return the error given above. This includes a write, read, write sequence; the first write will succeed, the read will fail, the second write will succeed even though the read told me that the handle isn't a socket. Only synchronous operations are being done on this socket. It's connected normally, no strange options are set on it, etc; the code is more or less the same as that found in the synchronous TCP client examples. Any solutions or workarounds to this problem would be greatly appreciated. I need to have IOCP disabled, so re-enabling it isn't a solution.

On Fri, Jan 22, 2010 at 10:30 AM, Collin Dauphinee
I have a piece of code that works completely fine with IOCP enabled, but when I disable it via the BOOST_ASIO_DISABLE_IOCP define, any attempts to call socket.read_some will throw an exception. This exception states that "An operation was attempted on something that is not a socket."
One possible reason for getting this error is that the socket you're trying to read from has been closed or shut down. Just something to look into. Emil Dotchevski Reverge Studios, Inc. http://www.revergestudios.com/reblog/index.php?n=ReCode
participants (2)
-
Collin Dauphinee
-
Emil Dotchevski