// stream_handle.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)
// Test that header file is self-contained.
#include <boost/asio/windows/stream_handle.hpp>
-#include <boost/asio/io_service.hpp>
+#include <boost/asio/io_context.hpp>
#include "../archetypes/async_result.hpp"
#include "../unit_test.hpp"
try
{
- io_service ios;
+ io_context ioc;
char mutable_char_buffer[128] = "";
const char const_char_buffer[128] = "";
archetypes::lazy_handler lazy;
// basic_stream_handle constructors.
- win::stream_handle handle1(ios);
+ win::stream_handle handle1(ioc);
HANDLE native_handle1 = INVALID_HANDLE_VALUE;
- win::stream_handle handle2(ios, native_handle1);
+ win::stream_handle handle2(ioc, native_handle1);
#if defined(BOOST_ASIO_HAS_MOVE)
win::stream_handle handle3(std::move(handle2));
// basic_stream_handle operators.
#if defined(BOOST_ASIO_HAS_MOVE)
- handle1 = win::stream_handle(ios);
+ handle1 = win::stream_handle(ioc);
handle1 = std::move(handle2);
#endif // defined(BOOST_ASIO_HAS_MOVE)
// basic_io_object functions.
- io_service& ios_ref = handle1.get_io_service();
- (void)ios_ref;
+#if !defined(BOOST_ASIO_NO_DEPRECATED)
+ io_context& ioc_ref = handle1.get_io_context();
+ (void)ioc_ref;
+#endif // !defined(BOOST_ASIO_NO_DEPRECATED)
+
+ io_context::executor_type ex = handle1.get_executor();
+ (void)ex;
// basic_handle functions.
handle1.close();
handle1.close(ec);
- win::stream_handle::native_type native_handle3 = handle1.native();
- (void)native_handle3;
-
- win::stream_handle::native_handle_type native_handle4
+ win::stream_handle::native_handle_type native_handle3
= handle1.native_handle();
- (void)native_handle4;
+ (void)native_handle3;
handle1.cancel();
handle1.cancel(ec);