X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=ceph%2Fsrc%2Fboost%2Flibs%2Fasio%2Fexample%2Fcpp03%2Fchat%2Fposix_chat_client.cpp;h=40844c94e49d23dec01d22df2e6626bcedba635b;hb=b32b81446b3b05102be0267e79203f59329c1d97;hp=c6e013448c616ab44cfdeb4a595be33284d39fb5;hpb=215dd7151453fae88e6f968c975b6ce309d42dcf;p=ceph.git diff --git a/ceph/src/boost/libs/asio/example/cpp03/chat/posix_chat_client.cpp b/ceph/src/boost/libs/asio/example/cpp03/chat/posix_chat_client.cpp index c6e013448..40844c94e 100644 --- a/ceph/src/boost/libs/asio/example/cpp03/chat/posix_chat_client.cpp +++ b/ceph/src/boost/libs/asio/example/cpp03/chat/posix_chat_client.cpp @@ -2,7 +2,7 @@ // posix_chat_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) @@ -24,14 +24,14 @@ namespace posix = boost::asio::posix; class posix_chat_client { public: - posix_chat_client(boost::asio::io_service& io_service, - tcp::resolver::iterator endpoint_iterator) - : socket_(io_service), - input_(io_service, ::dup(STDIN_FILENO)), - output_(io_service, ::dup(STDOUT_FILENO)), + posix_chat_client(boost::asio::io_context& io_context, + const tcp::resolver::results_type& endpoints) + : socket_(io_context), + input_(io_context, ::dup(STDIN_FILENO)), + output_(io_context, ::dup(STDOUT_FILENO)), input_buffer_(chat_message::max_body_length) { - boost::asio::async_connect(socket_, endpoint_iterator, + boost::asio::async_connect(socket_, endpoints, boost::bind(&posix_chat_client::handle_connect, this, boost::asio::placeholders::error)); } @@ -182,15 +182,14 @@ int main(int argc, char* argv[]) return 1; } - boost::asio::io_service io_service; + boost::asio::io_context io_context; - tcp::resolver resolver(io_service); - tcp::resolver::query query(argv[1], argv[2]); - tcp::resolver::iterator iterator = resolver.resolve(query); + tcp::resolver resolver(io_context); + tcp::resolver::results_type endpoints = resolver.resolve(argv[1], argv[2]); - posix_chat_client c(io_service, iterator); + posix_chat_client c(io_context, endpoints); - io_service.run(); + io_context.run(); } catch (std::exception& e) {