logo       

determining an endpoint's family - endpoint_type/protocol_type?: msg#00018

lib.boost.asio.user

Subject: determining an endpoint's family - endpoint_type/protocol_type?

I am developing an FTP client with boost::asio, and I wish to
determine whether an endpoint (generated by a resolver) is IPv4 or
IPv6.

The only way I can see how is to compare endpoint.protocol().family()
with AF_INET and AF_INET6, which doesn't feel like the right way. An
alternative would be to specify the desired family before the host is
resolved, or to simply compare the endpoint's family against some
predefined boost::asio::ip::ipv6/ipv4 members.

The difference between IPv4 and IPv6 is quite significant for FTP, as
they require a different set of (mostly incompatible) commands to
negotiate data connections.

Any suggestions? (Probably I have missed something :)

Richard

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise