2 // posix/descriptor_base.hpp
3 // ~~~~~~~~~~~~~~~~~~~~~~~~~
5 // Copyright (c) 2003-2017 Christopher M. Kohlhoff (chris at kohlhoff dot com)
7 // Distributed under the Boost Software License, Version 1.0. (See accompanying
8 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
11 #ifndef BOOST_ASIO_POSIX_DESCRIPTOR_BASE_HPP
12 #define BOOST_ASIO_POSIX_DESCRIPTOR_BASE_HPP
14 #if defined(_MSC_VER) && (_MSC_VER >= 1200)
16 #endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
18 #include <boost/asio/detail/config.hpp>
20 #if defined(BOOST_ASIO_HAS_POSIX_STREAM_DESCRIPTOR) \
21 || defined(GENERATING_DOCUMENTATION)
23 #include <boost/asio/detail/io_control.hpp>
24 #include <boost/asio/detail/socket_option.hpp>
26 #include <boost/asio/detail/push_options.hpp>
32 /// The descriptor_base class is used as a base for the basic_stream_descriptor
33 /// class template so that we have a common place to define the associated
34 /// IO control commands.
38 /// (Deprecated: Use non_blocking().) IO control command to set the blocking
39 /// mode of the descriptor.
41 * Implements the FIONBIO IO control command.
45 * boost::asio::posix::stream_descriptor descriptor(io_service);
47 * boost::asio::descriptor_base::non_blocking_io command(true);
48 * descriptor.io_control(command);
54 #if defined(GENERATING_DOCUMENTATION)
55 typedef implementation_defined non_blocking_io;
57 typedef boost::asio::detail::io_control::non_blocking_io non_blocking_io;
60 /// IO control command to get the amount of data that can be read without
63 * Implements the FIONREAD IO control command.
67 * boost::asio::posix::stream_descriptor descriptor(io_service);
69 * boost::asio::descriptor_base::bytes_readable command(true);
70 * descriptor.io_control(command);
71 * std::size_t bytes_readable = command.get();
77 #if defined(GENERATING_DOCUMENTATION)
78 typedef implementation_defined bytes_readable;
80 typedef boost::asio::detail::io_control::bytes_readable bytes_readable;
84 /// Protected destructor to prevent deletion through this type.
94 #include <boost/asio/detail/pop_options.hpp>
96 #endif // defined(BOOST_ASIO_HAS_POSIX_STREAM_DESCRIPTOR)
97 // || defined(GENERATING_DOCUMENTATION)
99 #endif // BOOST_ASIO_POSIX_DESCRIPTOR_BASE_HPP