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.