
17 Aug
2006
17 Aug
'06
4:03 p.m.
Another approach (although not strictly meeting your requirements) is to use the endpoint::port() setter function after resolution.
This is the approach I intended to use, but I couldn't figure out how to structure the query. First I tried: ip::tcp::resolver::query query("foobar.com"); But that sets the service to foobar.com, not the host. Then I tried: ip::tcp::resolver::query query("foobar.com", ""); But that failed. The getaddrinfo() function allows for the service string to be null, but there doesn't seem to be a way to achieve that with the asio interface (again unless I'm missing something). Thanks, Chris