]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/boost/libs/asio/test/ip/multicast.cpp
update sources to v12.2.3
[ceph.git] / ceph / src / boost / libs / asio / test / ip / multicast.cpp
index d0aa6413735058f56ec90af4b43e327a4e343147..77c2578985fb8a952375cb026c3cb6dd84068ae6 100644 (file)
@@ -2,7 +2,7 @@
 // multicast.cpp
 // ~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2016 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2017 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -16,7 +16,7 @@
 // Test that header file is self-contained.
 #include <boost/asio/ip/multicast.hpp>
 
-#include <boost/asio/io_service.hpp>
+#include <boost/asio/io_context.hpp>
 #include <boost/asio/ip/udp.hpp>
 #include "../unit_test.hpp"
 
@@ -36,8 +36,8 @@ void test()
 
   try
   {
-    io_service ios;
-    ip::udp::socket sock(ios);
+    io_context ioc;
+    ip::udp::socket sock(ioc);
     const ip::address address;
     const ip::address_v4 address_v4;
     const ip::address_v6 address_v6;
@@ -116,17 +116,17 @@ void test()
   using namespace boost::asio;
   namespace ip = boost::asio::ip;
 
-  io_service ios;
+  io_context ioc;
   boost::system::error_code ec;
 
   ip::udp::endpoint ep_v4(ip::address_v4::loopback(), 0);
-  ip::udp::socket sock_v4(ios);
+  ip::udp::socket sock_v4(ioc);
   sock_v4.open(ep_v4.protocol(), ec);
   sock_v4.bind(ep_v4, ec);
   bool have_v4 = !ec;
 
   ip::udp::endpoint ep_v6(ip::address_v6::loopback(), 0);
-  ip::udp::socket sock_v6(ios);
+  ip::udp::socket sock_v6(ioc);
   sock_v6.open(ep_v6.protocol(), ec);
   sock_v6.bind(ep_v6, ec);
   bool have_v6 = !ec;
@@ -137,11 +137,9 @@ void test()
   // Windows CE seems to have problems with some multicast group addresses.
   // The following address works on CE, but as it is not a private multicast
   // address it will not be used on other platforms.
-  const ip::address multicast_address_v4 =
-    ip::address::from_string("239.0.0.4", ec);
+  const ip::address multicast_address_v4 = ip::make_address("239.0.0.4", ec);
 #else // defined(BOOST_ASIO_WINDOWS) && defined(UNDER_CE)
-  const ip::address multicast_address_v4 =
-    ip::address::from_string("239.255.0.1", ec);
+  const ip::address multicast_address_v4 = ip::make_address("239.255.0.1", ec);
 #endif // defined(BOOST_ASIO_WINDOWS) && defined(UNDER_CE)
   BOOST_ASIO_CHECK(!have_v4 || !ec);
 
@@ -149,14 +147,12 @@ void test()
   || defined(__FreeBSD__) \
   || defined(__NetBSD__) \
   || defined(__OpenBSD__)
-  const ip::address multicast_address_v6 =
-    ip::address::from_string("ff02::1%lo0", ec);
+  const ip::address multicast_address_v6 = ip::make_address("ff02::1%lo0", ec);
 #else // (defined(__MACH__) && defined(__APPLE__))
       //   || defined(__FreeBSD__)
       //   || defined(__NetBSD__)
       //   || defined(__OpenBSD__)
-  const ip::address multicast_address_v6 =
-    ip::address::from_string("ff01::1", ec);
+  const ip::address multicast_address_v6 = ip::make_address("ff01::1", ec);
 #endif // (defined(__MACH__) && defined(__APPLE__))
        //   || defined(__FreeBSD__)
        //   || defined(__NetBSD__)