c++ - Getting the IP address of a received message in boost -


how can retrieve ip address boost when receive udp message(using boost::asio::ip::udp)?

thanks!

you can using

boost::asio::ip::udp::socket::async_receive_from()

or

boost::asio::ip::udp::socket::receive_from()

functions, have endpoint_type & sender_endpoint output parameter. returned endpoint can used resolve sender ip address.


Comments