21 Nov
2010
21 Nov
'10
9:59 p.m.
Acceptor.async_accept(NewConnection->socket(),boost::bind(&TCPServer::HandleAccept,this, NewConnection,boost::asio::placeholders::error)); } catch(std::exception& e) { cout<<"exception"<
Another program is already listening on the port "13" (A service version of the same program). When this new program tries to listen (async_accept) on port "13", no exception is thrown!.
How can I check weather the port is already open?
async_XXX functions do not throw, they guarantee that the completion handler will always be invoked. So what you should check is the error_code in your completion handler.