Re: [Boost-users] How to get the port number and the address of a boost::asio::ip::tcp:acceptor object

7 Aug
2008
7 Aug
'08
5:40 p.m.
Hi, The following code: boost::asio::ip::tcp::acceptor myacceptor(m_IoService); myacceptor.open(boost::asio::ip::tcp::v4()); boost::asio::ip::tcp::endpoint endpoint = myacceptor.local_endpoint(); generates the following exception: "An invalid argument was supplied" when myacceptor.local_endpoint() is invoked. any idea? On 8/7/08, Igor R <boost.lists@gmail.com> wrote:
Then when I do:
boost::asio::ip::tcp::acceptor acceptor(m_IoService);
when I call
boost::asio::ip::tcp::endpoint endpoint = acceptor.local_endpoint();
I get an exception as follow: "The file handle supplied is not valid"
You have to open() the acceptor: http://www.boost.org/doc/libs/1_35_0/doc/html/boost_asio/reference/basic_soc...
6149
Age (days ago)
6149
Last active (days ago)
0 comments
1 participants
participants (1)
-
Jean-Sebastien Stoezel