]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/boost/libs/asio/test/latency/tcp_client.cpp
update sources to v12.2.3
[ceph.git] / ceph / src / boost / libs / asio / test / latency / tcp_client.cpp
index bb8a0820ab7f4864d4b10f92a44ac012cb13416a..8779810af2ad6af3dd228421b920d51d32882a1e 100644 (file)
@@ -2,7 +2,7 @@
 // tcp_client.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)
@@ -50,22 +50,21 @@ int main(int argc, char* argv[])
   std::size_t buf_size = static_cast<std::size_t>(std::atoi(argv[4]));
   bool spin = (std::strcmp(argv[5], "spin") == 0);
 
-  boost::asio::io_service io_service;
+  boost::asio::io_context io_context;
   std::vector<boost::shared_ptr<tcp::socket> > sockets;
 
   for (int i = 0; i < num_connections; ++i)
   {
-    boost::shared_ptr<tcp::socket> s(new tcp::socket(io_service));
+    boost::shared_ptr<tcp::socket> s(new tcp::socket(io_context));
 
-    tcp::endpoint target(boost::asio::ip::address::from_string(ip), port);
+    tcp::endpoint target(boost::asio::ip::make_address(ip), port);
     s->connect(target);
 
     s->set_option(tcp::no_delay(true));
 
     if (spin)
     {
-      tcp::socket::non_blocking_io nbio(true);
-      s->io_control(nbio);
+      s->non_blocking(true);
     }
 
     sockets.push_back(s);