From: Cory Nelson (phrosty_at_[hidden])
Date: 2006-06-26 01:06:57
On 6/25/06, Christopher Kohlhoff <chris_at_[hidden]> wrote:
> Hi Peter,
> Peter Petrov <ppetrov_at_[hidden]> wrote:
> > There is one thing that caught my eye. In the changelog you
> > have the following comment:
> >> * Resolver replaces ipv4::host_resolver.
> >> ...
> >> ip::tcp::resolver resolver(io_service);
> > Why is "resolver" in the "ip::tcp" namespace? A DNS resolver
> > certainly has nothing to do with the TCP protocol. It should
> > be in the "ip" namespace instead.
> Unlike the old host_resolver class, which would resolve a host
> name into an address, the new resolvers turn host name and
> service name into a list of endpoints. This interface is based
> on getaddrinfo() function.
> We now have:
> - ip::tcp::resolver, which returns a list of ip::tcp::endpoint
> - ip::udp::resolver, which returns a list of ip::udp::endpoint
> Resolvers for other protocols, can (if supported by getaddrinfo
> on the target platform) be created by instantiating the
> asio::basic_resolver<> template on an appropriately defined
> protocol class.
> So, ip::tcp::resolver is very much specific to TCP, but
> basic_resolver<> isn't - it's not even specific to IP (in
> theory, anyway).
I'd still love to see a utility function connect_host which resolves
creates a socket and connects. considering nearly every app will end
up rewriting the wheel so to speek with that.
> Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
-- Cory Nelson http://www.int64.org