// async_udp_echo_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)
class server
{
public:
- server(boost::asio::io_service& io_service, short port)
- : socket_(io_service, udp::endpoint(udp::v4(), port))
+ server(boost::asio::io_context& io_context, short port)
+ : socket_(io_context, udp::endpoint(udp::v4(), port))
{
socket_.async_receive_from(
boost::asio::buffer(data_, max_length), sender_endpoint_,
return 1;
}
- boost::asio::io_service io_service;
+ boost::asio::io_context io_context;
using namespace std; // For atoi.
- server s(io_service, atoi(argv[1]));
+ server s(io_context, atoi(argv[1]));
- io_service.run();
+ io_context.run();
}
catch (std::exception& e)
{