Boost logo

Boost Users :

Subject: [Boost-users] boost::Asio async_accept not throwing exception
From: Lloyd Kanakkassery (lloydkl.tech_at_[hidden])
Date: 2010-11-21 06:12:01


Hi,

I have modified the sample program provided in the asio samples, just to
accept a connection like this

void TCPServer::StartAccept()
{
    try
    {
        TCPConnection::Pointer
NewConnection=TCPConnection::Create(Acceptor.io_service());

Acceptor.async_accept(NewConnection->socket(),boost::bind(&TCPServer::HandleAccept,this,
NewConnection,boost::asio::placeholders::error));
    }
    catch(std::exception& e)
    {
       cout<<"exception"<<endl;
    }
}

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?

Thanks,
  Lloyd



Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net