Boost C++ Libraries: Ticket #4683: Infinite loop in async_connect to 0.0.0.0:0 (boost::asio) https://svn.boost.org/trac10/ticket/4683 <p> Compiler: MSVS<br /> Platform: MS Windows XP<br /> BOOST_ASIO_HAS_IOCP is enabled<br /> <br /> async_connect to 0.0.0.0:0 led to infinite loop in boost::asio.<br /> Infinite loop is occured in select_reactor::run_thread(). It call select() (through select_reactor::run) and expect block execution by this function. But select immediately return 10038(WSAENOTSOCK). It lead to infinit use processor.<br /> <br /> Of course connect to 0.0.0.0:0 is error, but asio must never go to infinite loop. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/4683 Trac 1.4.3 chris_kohlhoff Sat, 16 Oct 2010 07:44:18 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/4683#comment:1 https://svn.boost.org/trac10/ticket/4683#comment:1 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">worksforme</span> </li> </ul> <p> I cannot reproduce this problem. This test program: </p> <pre class="wiki">#include &lt;boost/asio/ip/tcp.hpp&gt; #include &lt;iostream&gt; using boost::asio::ip::tcp; void handle_connect(const boost::system::error_code&amp; ec) { std::cout &lt;&lt; "handle_connect(" &lt;&lt; ec.message() &lt;&lt; ")\n"; } int main() { try { boost::asio::io_service io_service; tcp::socket sock(io_service); tcp::endpoint ep; std::cout &lt;&lt; "Connecting to " &lt;&lt; ep &lt;&lt; "\n"; sock.async_connect(ep, handle_connect); io_service.run(); } catch (std::exception&amp; e) { std::cout &lt;&lt; "Exception: " &lt;&lt; e.what() &lt;&lt; "\n"; } } </pre><p> outputs the following for me on Windows XP: </p> <pre class="wiki">Connecting to 0.0.0.0:0 handle_connect(The requested address is not valid in its context) </pre><p> Please supply a more complete test case and reopen the bug. Thanks. </p> Ticket