Boost logo

Boost :

Subject: Re: [boost] [asio] resolve hostname from numeric IP address?
From: Andreas Masur (amasur_at_[hidden])
Date: 2009-03-15 18:37:52


On Mar 14, 2009, at 3:20 PM, Brian and Victoria wrote:

> This took several hours of web searching and trying to make sense of
> the asio documentation, but...
>
> <snip>
> boost::asio::ip::tcp::endpoint
> ep(boost::asio::ip::address_v4(0xD155AB64), 80); // 209.85.171.100:80
> boost::asio::ip::tcp::resolver resolver(ios);
> boost::asio::ip::tcp::resolver::iterator iter = resolver.resolve(ep);
> boost::asio::ip::tcp::resolver::iterator end;
> while (iter != end)
> {
> std::cerr << (*iter).host_name() << std::endl; // cg-in-
> f100.google.com
> ++iter;
> }
> <snip>
>
> ...produces the desired results.
>
> I'm posting this because I found other posts like mine that had not
> been responded to.

Thanks for posting this....may be this could *now* be included in the
documentation.....

Ciao, Andreas


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk