[ASIO] Newbie; How can I access remote_endpoint data in an SSL server
Can anybody help a boost::newbie I have generated an ASIO SSL server based on the sample code "server.cpp" How can I determine the Client Address from the ssl_socket which is defined as typedef boost::asio::ssl::streamboost::asio::ip::tcp::socket ssl_socket; relevant code is: acceptor_.async_accept(new_session->socket(), boost::bind(&server::handle_accept, this, new_session, boost::asio::placeholders::error)); Thank You
How can I determine the Client Address from the ssl_socket which is defined as
typedef boost::asio::ssl::streamboost::asio::ip::tcp::socket ssl_socket;
ssl_socket::lowest_layer() gives you reference to the underlaying tcp socket (actually, to basic_stream_socket). From there, you can use any socket methods: http://www.boost.org/doc/libs/1_37_0/doc/html/boost_asio/reference/basic_str... Eg., sslSocket.lowest_layer().remote_endpoint();// etc
participants (2)
-
Igor R
-
May James