// datagram_protocol.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)
#include <boost/asio/local/datagram_protocol.hpp>
#include <cstring>
-#include <boost/asio/io_service.hpp>
+#include <boost/asio/io_context.hpp>
#include "../unit_test.hpp"
//------------------------------------------------------------------------------
try
{
- io_service ios;
+ io_context ioc;
char mutable_char_buffer[128] = "";
const char const_char_buffer[128] = "";
socket_base::message_flags in_flags = 0;
// basic_datagram_socket constructors.
- dp::socket socket1(ios);
- dp::socket socket2(ios, dp());
- dp::socket socket3(ios, dp::endpoint(""));
+ dp::socket socket1(ioc);
+ dp::socket socket2(ioc, dp());
+ dp::socket socket3(ioc, dp::endpoint(""));
int native_socket1 = ::socket(AF_UNIX, SOCK_DGRAM, 0);
- dp::socket socket4(ios, dp(), native_socket1);
+ dp::socket socket4(ioc, dp(), native_socket1);
// basic_io_object functions.
- io_service& ios_ref = socket1.get_io_service();
- (void)ios_ref;
+#if !defined(BOOST_ASIO_NO_DEPRECATED)
+ io_context& ioc_ref = socket1.get_io_context();
+ (void)ioc_ref;
+#endif // !defined(BOOST_ASIO_NO_DEPRECATED)
+
+ dp::socket::executor_type ex = socket1.get_executor();
+ (void)ex;
// basic_socket functions.
socket1.close();
socket1.close(ec);
- dp::socket::native_type native_socket4 = socket1.native();
+ dp::socket::native_handle_type native_socket4 = socket1.native_handle();
(void)native_socket4;
socket1.cancel();