]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/boost/libs/asio/test/is_read_buffered.cpp
update sources to v12.2.3
[ceph.git] / ceph / src / boost / libs / asio / test / is_read_buffered.cpp
index b1574e6bcce81ab1d987b672b47b347d94e901ba..6d345d755fbbfc7e8d2fefa43c76b5be19d34822 100644 (file)
@@ -2,7 +2,7 @@
 // is_read_buffered.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)
@@ -18,7 +18,7 @@
 
 #include <boost/asio/buffered_read_stream.hpp>
 #include <boost/asio/buffered_write_stream.hpp>
-#include <boost/asio/io_service.hpp>
+#include <boost/asio/io_context.hpp>
 #include <boost/asio/ip/tcp.hpp>
 #include "unit_test.hpp"
 
@@ -27,18 +27,20 @@ using namespace std; // For memcmp, memcpy and memset.
 class test_stream
 {
 public:
-  typedef boost::asio::io_service io_service_type;
+  typedef boost::asio::io_context io_context_type;
 
   typedef test_stream lowest_layer_type;
 
-  test_stream(boost::asio::io_service& io_service)
-    : io_service_(io_service)
+  typedef io_context_type::executor_type executor_type;
+
+  test_stream(boost::asio::io_context& io_context)
+    : io_context_(io_context)
   {
   }
 
-  io_service_type& io_service()
+  io_context_type& io_context()
   {
-    return io_service_;
+    return io_context_;
   }
 
   lowest_layer_type& lowest_layer()
@@ -63,7 +65,8 @@ public:
   void async_write(const Const_Buffers&, Handler handler)
   {
     boost::system::error_code error;
-    io_service_.post(boost::asio::detail::bind_handler(handler, error, 0));
+    boost::asio::post(io_context_,
+        boost::asio::detail::bind_handler(handler, error, 0));
   }
 
   template <typename Mutable_Buffers>
@@ -83,11 +86,12 @@ public:
   void async_read(const Mutable_Buffers&, Handler handler)
   {
     boost::system::error_code error;
-    io_service_.post(boost::asio::detail::bind_handler(handler, error, 0));
+    boost::asio::post(io_context_,
+        boost::asio::detail::bind_handler(handler, error, 0));
   }
 
 private:
-  io_service_type& io_service_;
+  io_context_type& io_context_;
 };
 
 void is_read_buffered_test()