In one message on the boost mailing list, someone else seemed to do it like this (copied, reformatted, service number changed, nothing more):
namespace bai = boost::asio::ip; bai::tcp::endpoint ep(bai::address_v4(0xD155AB64), 0); // 209.85.171.100:0 boost::asio::io_service ios; bai::tcp::resolver resolver(ios); bai::tcp::resolver::iterator iter = resolver.resolve(ep); bai::tcp::resolver::iterator end; while (iter != end) { std::cerr << (*iter).host_name() << std::endl; // cg-in-f100.google.com ++iter; }
As you rightly said, the service is still being transmitted here, but the step through the Boost.Asio code showed this (in resolver_service.hpp , I use the rather old version 1.36):
So just go with 0 and it should do what you want.
gimpf
source share