X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=ceph%2Fsrc%2Fboost%2Flibs%2Fasio%2Ftest%2Fsocket_base.cpp;h=37fbe5fb7343196769b07544b587098bc2248d9c;hb=b32b81446b3b05102be0267e79203f59329c1d97;hp=6986b0a10963aa86e3c77224ba6124f33935ba9c;hpb=215dd7151453fae88e6f968c975b6ce309d42dcf;p=ceph.git diff --git a/ceph/src/boost/libs/asio/test/socket_base.cpp b/ceph/src/boost/libs/asio/test/socket_base.cpp index 6986b0a10..37fbe5fb7 100644 --- a/ceph/src/boost/libs/asio/test/socket_base.cpp +++ b/ceph/src/boost/libs/asio/test/socket_base.cpp @@ -2,7 +2,7 @@ // socket_base.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 -#include +#include #include #include #include "unit_test.hpp" @@ -37,8 +37,8 @@ void test() try { - io_service ios; - ip::tcp::socket sock(ios); + io_context ioc; + ip::tcp::socket sock(ioc); char buf[1024]; // shutdown_type enumeration. @@ -155,6 +155,17 @@ void test() linger1.timeout(1); (void)static_cast(linger1.timeout()); + // out_of_band_inline class. + + socket_base::out_of_band_inline out_of_band_inline1(true); + sock.set_option(out_of_band_inline1); + socket_base::out_of_band_inline out_of_band_inline2; + sock.get_option(out_of_band_inline2); + out_of_band_inline1 = true; + (void)static_cast(out_of_band_inline1); + (void)static_cast(!out_of_band_inline1); + (void)static_cast(out_of_band_inline1.value()); + // enable_connection_aborted class. socket_base::enable_connection_aborted enable_connection_aborted1(true); @@ -166,11 +177,6 @@ void test() (void)static_cast(!enable_connection_aborted1); (void)static_cast(enable_connection_aborted1.value()); - // non_blocking_io class. - - socket_base::non_blocking_io non_blocking_io(true); - sock.io_control(non_blocking_io); - // bytes_readable class. socket_base::bytes_readable bytes_readable; @@ -199,10 +205,10 @@ void test() using namespace boost::asio; namespace ip = boost::asio::ip; - io_service ios; - ip::udp::socket udp_sock(ios, ip::udp::v4()); - ip::tcp::socket tcp_sock(ios, ip::tcp::v4()); - ip::tcp::acceptor tcp_acceptor(ios, ip::tcp::v4()); + io_context ioc; + ip::udp::socket udp_sock(ioc, ip::udp::v4()); + ip::tcp::socket tcp_sock(ioc, ip::tcp::v4()); + ip::tcp::acceptor tcp_acceptor(ioc, ip::tcp::v4()); boost::system::error_code ec; // broadcast class. @@ -625,16 +631,6 @@ void test() BOOST_ASIO_CHECK(!static_cast(enable_connection_aborted4)); BOOST_ASIO_CHECK(!enable_connection_aborted4); - // non_blocking_io class. - - socket_base::non_blocking_io non_blocking_io1(true); - tcp_sock.io_control(non_blocking_io1, ec); - BOOST_ASIO_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message()); - - socket_base::non_blocking_io non_blocking_io2(false); - tcp_sock.io_control(non_blocking_io2, ec); - BOOST_ASIO_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message()); - // bytes_readable class. socket_base::bytes_readable bytes_readable;