
What do you mean by "port number and ip address of an acceptor"? If
you want to know the address of your local "endpoint", then you can
get it:
boost::asio::ip::tcp::endpoint endpoint = acceptor.local_endpoint();
then get its address and port:
endpoint.address();
endpoint.port();
But if you want to get the address of your peer, then you can get it
from accept() or async_accept() -- please see their descriptions.
P.S. IMHO, asio has *very* clear, readable, and useful manual, and I'm
sure you could find there aswers to most of your questions:
http://www.boost.org/doc/libs/1_35_0/doc/html/boost_asio.html
2008/8/7, Jean-Sebastien Stoezel
Hi,
How to get the port number and ip address of an acceptor?
I tried this:
boost::asio::ip::tcp::acceptor acceptor(m_IoService); boost::asio::ip::tcp::acceptor myEndPoint(m_IoService);
acceptor.get_option(myEndPoint);
But this does not compile, Iget a couple of errors in win_iocp_socket_service.hpp like this one:
Error 8 error C2039: 'level' : is not a member of 'boost::asio::basic_socket_acceptor<Protocol>'