Сокет имеет функцию, которая будет извлекать удаленную конечную точку. Я бы дал эту (длинную) цепочку команд, они должны получить строковое представление IP-адреса удаленного конца:
asio::ip::tcp::socket socket(io_service);
// Do all your accepting and other stuff here.
asio::ip::tcp::endpoint remote_ep = socket.remote_endpoint();
asio::ip::address remote_ad = remote_ep.address();
std::string s = remote_ad.to_string();
или однострочная версия:
asio::ip::tcp::socket socket(io_service);
// Do all your accepting and other stuff here.
std::string s = socket.remote_endpoint().address().to_string();