Boost C++ Libraries: Ticket #11527: socket connection error https://svn.boost.org/trac10/ticket/11527 <p> image the following code! it uses 2 threads and creates simple server client connection the code is simple and I use synchronize functions to make it easier to understand. in the client thread if I use : </p> <p> while (error_ &amp;&amp; it != end) </p> <blockquote> <p> { skt.close(); <em> skt is socket skt.connect(*it++, error_); } </em></p> </blockquote> <p> the the program crashes when it want to read or write something to the socket !! but if I use:boost::asio::connect(skt, it); then I works perfectly!!! notice that i will have this problem only if I use the code in two threads inside a single process. if I run the code in two different processes everything is fine. I am using windows 7 x67 and VS2013 but I am using 32bit project and 32bit boost library . </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/11527 Trac 1.4.3 danial1360@… Thu, 06 Aug 2015 13:53:34 GMT attachment set https://svn.boost.org/trac10/ticket/11527 https://svn.boost.org/trac10/ticket/11527 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">BUG.cpp</span> </li> </ul> <p> source code of the problem </p> Ticket