]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/boost/libs/asio/example/cpp03/serialization/server.cpp
update sources to v12.2.3
[ceph.git] / ceph / src / boost / libs / asio / example / cpp03 / serialization / server.cpp
index b9034bc329204d752bc336e63700a622b87d0a8a..6fb4881d9484b14842fd52ce7c87a1260a8edbea 100644 (file)
@@ -2,7 +2,7 @@
 // server.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)
@@ -25,8 +25,8 @@ class server
 public:
   /// Constructor opens the acceptor and starts waiting for the first incoming
   /// connection.
-  server(boost::asio::io_service& io_service, unsigned short port)
-    : acceptor_(io_service,
+  server(boost::asio::io_context& io_context, unsigned short port)
+    : acceptor_(io_context,
         boost::asio::ip::tcp::endpoint(boost::asio::ip::tcp::v4(), port))
   {
     // Create the data to be sent to each client.
@@ -55,7 +55,7 @@ public:
     stocks_.push_back(s);
 
     // Start an accept operation for a new connection.
-    connection_ptr new_conn(new connection(acceptor_.get_io_service()));
+    connection_ptr new_conn(new connection(acceptor_.get_io_context()));
     acceptor_.async_accept(new_conn->socket(),
         boost::bind(&server::handle_accept, this,
           boost::asio::placeholders::error, new_conn));
@@ -75,7 +75,7 @@ public:
     }
 
     // Start an accept operation for a new connection.
-    connection_ptr new_conn(new connection(acceptor_.get_io_service()));
+    connection_ptr new_conn(new connection(acceptor_.get_io_context()));
     acceptor_.async_accept(new_conn->socket(),
         boost::bind(&server::handle_accept, this,
           boost::asio::placeholders::error, new_conn));
@@ -110,9 +110,9 @@ int main(int argc, char* argv[])
     }
     unsigned short port = boost::lexical_cast<unsigned short>(argv[1]);
 
-    boost::asio::io_service io_service;
-    s11n_example::server server(io_service, port);
-    io_service.run();
+    boost::asio::io_context io_context;
+    s11n_example::server server(io_context, port);
+    io_context.run();
   }
   catch (std::exception& e)
   {