Get IP address of a client

-----Original Message----- From: boost-users-bounces@lists.boost.org [mailto:boost-users-bounces@lists.boost.org] On Behalf Of Rouven Walter Sent: Wednesday, May 19, 2010 8:26 To: boost-users@lists.boost.org Subject: [Boost-users] Get IP address of a client
Hello,
I use the asio boost library for network traffic. Is there a way to get the IP address of a client directly if the server receives data over a socket object, so that the IP address has not to be sent within the data. Normally this should be possible, since TCP pakets holds the ip address of receiver and sender in the header information. But how can I get these header information with the asio library?
There is an overload of the async_accept member function that provides this information: template< typename SocketService, typename AcceptHandler> void async_accept( basic_socket< protocol_type, SocketService > & peer, endpoint_type & peer_endpoint, AcceptHandler handler); More information: http://www.boost.org/doc/libs/1_43_0/doc/html/boost_asio/reference/basic_soc... There is an equivalent in the synchronous API. ~Dan
participants (2)
-
Casimiro, Daniel C CIV NUWC NWPT
-
Rouven Walter