]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/boost/libs/asio/example/cpp11/invocation/prioritised_handlers.cpp
import new upstream nautilus stable release 14.2.8
[ceph.git] / ceph / src / boost / libs / asio / example / cpp11 / invocation / prioritised_handlers.cpp
index 99ea7454f2260931d24a1e5e069da5a3cf4cd73c..bd99fd049d056cc90ee8640aa495f112ccb4e717 100644 (file)
@@ -2,7 +2,7 @@
 // prioritised_handlers.cpp
 // ~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2019 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)
@@ -15,7 +15,7 @@
 
 using boost::asio::ip::tcp;
 
-class handler_priority_queue : boost::asio::execution_context
+class handler_priority_queue : public boost::asio::execution_context
 {
 public:
   template <typename Function>
@@ -142,7 +142,8 @@ private:
 
 //----------------------------------------------------------------------
 
-void high_priority_handler(const boost::system::error_code& /*ec*/)
+void high_priority_handler(const boost::system::error_code& /*ec*/,
+    tcp::socket /*socket*/)
 {
   std::cout << "High priority handler\n";
 }
@@ -178,8 +179,7 @@ int main()
   tcp::endpoint endpoint(boost::asio::ip::address_v4::loopback(), 0);
   tcp::acceptor acceptor(io_context, endpoint);
   tcp::socket server_socket(io_context);
-  acceptor.async_accept(server_socket,
-      pri_queue.wrap(100, high_priority_handler));
+  acceptor.async_accept(pri_queue.wrap(100, high_priority_handler));
   tcp::socket client_socket(io_context);
   client_socket.connect(acceptor.local_endpoint());