Boost C++ Libraries: Ticket #12925: boost::asio::ip::tcp::socket::async_read_some() changes socket to non-blocking https://svn.boost.org/trac10/ticket/12925 <p> I'm not sure if it's an issue or not, so I'll try to explain without lots of code examples: </p> <p> I have a socket: </p> <pre class="wiki">boost::asio::ip::tcp::socket sock(ioservice); sock.open(boost::asio::ip::tcp::v4()); </pre><p> I've connected the socket to external application with a third party API, which is a blocking call (for a blocking socket): </p> <pre class="wiki">third_party_connect(sock.native(), ip); </pre><p> And waited for some data on this socket: </p> <pre class="wiki">mSubSock.async_read_some(boost::asio::null_buffers(), std::bind(&amp;MyClass::OnData, this, std::placeholders::_1)); </pre><p> When MyClass::<a class="missing wiki">OnData</a> got called, I've noticed that the socket turned to non blocking socket: </p> <pre class="wiki">sock.native_non_blocking(); -&gt; returns 'true' anotherThirdPartyAPI(sub.native()); -&gt; fails with EAGAIN because socket turned to non-blocking </pre><p> Then another third party API call fails inside the MyClass::<a class="missing wiki">OnData</a> function with errno: EAGAIN. </p> <p> Is this the expected behaviour? why did my socket changed to non-blocking? (I've checked before the call to 'async_read_some' and it was blocking). I hope I was clear enough. Thanks </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/12925 Trac 1.4.3