id,summary,reporter,owner,description,type,status,milestone,component,version,severity,resolution,keywords,cc 9794,"Calling async_read_some before(tcp::socket, ...) before tcp::socket::async_connect handler is called causes async_connect handler to indicate successful connect",tim.pavlic@…,chris_kohlhoff,"Given the example in this ticket, and assuming that there is no service running on localhost:29873, I would expect the example to print: {{{ Failed to read Failed to connect }}} Instead I get: {{{ Failed to read Connected! }}} {{{ #!cpp #include #include #include #include #include #include using namespace std; using namespace boost; using boost::asio::ip::tcp; int main(int argc, char* argv[]) { asio::io_service ios; tcp::socket socket{ios}; tcp::endpoint endpoint(asio::ip::address::from_string(""127.0.0.1""), 29873); socket.async_connect(endpoint, [](const system::error_code& ec) { if ( !ec ) { cout << ""Connected!"" << endl; } else { cout << ""Failed to connect"" << endl; } }); asio::streambuf readBuffer; asio::async_read_until(socket, readBuffer, '\n', [](const system::error_code& ec, size_t size) { if ( !ec ) { cout << ""Read "" << size << "" "" << endl; } else { cout << ""Failed to read"" << endl; } }); ios.run(); } }}} I also have the same problem in boost 1.48. I know it's not really logical to do what the example shows, but I would not expect the result it gives.",Bugs,new,To Be Determined,asio,Boost 1.55.0,Problem,,,