Boost logo

Boost-Commit :

From: chris_at_[hidden]
Date: 2007-09-01 02:08:52


Author: chris_kohlhoff
Date: 2007-09-01 02:08:45 EDT (Sat, 01 Sep 2007)
New Revision: 39092
URL: http://svn.boost.org/trac/boost/changeset/39092

Log:
Need to try binding the acceptor to test whether IPv6 is supported.

Text files modified:
   trunk/libs/asio/test/ip/v6_only.cpp | 6 +++++-
   1 files changed, 5 insertions(+), 1 deletions(-)

Modified: trunk/libs/asio/test/ip/v6_only.cpp
==============================================================================
--- trunk/libs/asio/test/ip/v6_only.cpp (original)
+++ trunk/libs/asio/test/ip/v6_only.cpp 2007-09-01 02:08:45 EDT (Sat, 01 Sep 2007)
@@ -73,9 +73,13 @@
   io_service ios;
   boost::system::error_code ec;
 
+ ip::tcp::endpoint ep_v6(ip::address_v6::loopback(), 0);
   ip::tcp::acceptor acceptor_v6(ios);
- acceptor_v6.open(ip::tcp::v6(), ec);
+ acceptor_v6.open(ep_v6.protocol(), ec);
+ acceptor_v6.bind(ep_v6, ec);
   bool have_v6 = !ec;
+ acceptor_v6.close(ec);
+ acceptor_v6.open(ep_v6.protocol(), ec);
 
   if (have_v6)
   {


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk