Boost logo

Boost :

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); //
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; //

...produces the desired results.

I'm posting this because I found other posts like mine that had not been
responded to.


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., maps to localhost).
> If so, a pointer to an example would be greatly appreciated.
> Thanks,
> Brian

Boost list run by bdawes at, gregod at, cpdaniel at, john at