Subject: Re: [boost] [asio] resolve hostname from numeric IP address?
From: Brian and Victoria (bnv_at_[hidden])
Date: 2009-03-14 15:20:24
This took several hours of web searching and trying to make sense of the
asio documentation, but...
ep(boost::asio::ip::address_v4(0xD155AB64), 80); // 220.127.116.11:80
boost::asio::ip::tcp::resolver::iterator iter = resolver.resolve(ep);
while (iter != end)
std::cerr << (*iter).host_name() << std::endl; // cg-in-f100.google.com
...produces the desired results.
I'm posting this because I found other posts like mine that had not been
Brian and Victoria wrote:
> I'm having trouble parsing the documentation, and am trying to
> determine if asio supports gethostbyaddr() functionality.
> The resolver appears to support hostname to addr queries, but I'm
> looking for addr to hostname (e.g., 127.0.0.1 maps to localhost).
> If so, a pointer to an example would be greatly appreciated.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk