Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:29:00

0001 //
0002 // local/stream_protocol.hpp
0003 // ~~~~~~~~~~~~~~~~~~~~~~~~~
0004 //
0005 // Copyright (c) 2003-2023 Christopher M. Kohlhoff (chris at kohlhoff dot com)
0006 //
0007 // Distributed under the Boost Software License, Version 1.0. (See accompanying
0008 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
0009 //
0010 
0011 #ifndef BOOST_ASIO_LOCAL_STREAM_PROTOCOL_HPP
0012 #define BOOST_ASIO_LOCAL_STREAM_PROTOCOL_HPP
0013 
0014 #if defined(_MSC_VER) && (_MSC_VER >= 1200)
0015 # pragma once
0016 #endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
0017 
0018 #include <boost/asio/detail/config.hpp>
0019 
0020 #if defined(BOOST_ASIO_HAS_LOCAL_SOCKETS) \
0021   || defined(GENERATING_DOCUMENTATION)
0022 
0023 #include <boost/asio/basic_socket_acceptor.hpp>
0024 #include <boost/asio/basic_socket_iostream.hpp>
0025 #include <boost/asio/basic_stream_socket.hpp>
0026 #include <boost/asio/detail/socket_types.hpp>
0027 #include <boost/asio/local/basic_endpoint.hpp>
0028 
0029 #include <boost/asio/detail/push_options.hpp>
0030 
0031 namespace boost {
0032 namespace asio {
0033 namespace local {
0034 
0035 /// Encapsulates the flags needed for stream-oriented UNIX sockets.
0036 /**
0037  * The boost::asio::local::stream_protocol class contains flags necessary for
0038  * stream-oriented UNIX domain sockets.
0039  *
0040  * @par Thread Safety
0041  * @e Distinct @e objects: Safe.@n
0042  * @e Shared @e objects: Safe.
0043  *
0044  * @par Concepts:
0045  * Protocol.
0046  */
0047 class stream_protocol
0048 {
0049 public:
0050   /// Obtain an identifier for the type of the protocol.
0051   int type() const noexcept
0052   {
0053     return SOCK_STREAM;
0054   }
0055 
0056   /// Obtain an identifier for the protocol.
0057   int protocol() const noexcept
0058   {
0059     return 0;
0060   }
0061 
0062   /// Obtain an identifier for the protocol family.
0063   int family() const noexcept
0064   {
0065     return AF_UNIX;
0066   }
0067 
0068   /// The type of a UNIX domain endpoint.
0069   typedef basic_endpoint<stream_protocol> endpoint;
0070 
0071   /// The UNIX domain socket type.
0072   typedef basic_stream_socket<stream_protocol> socket;
0073 
0074   /// The UNIX domain acceptor type.
0075   typedef basic_socket_acceptor<stream_protocol> acceptor;
0076 
0077 #if !defined(BOOST_ASIO_NO_IOSTREAM)
0078   /// The UNIX domain iostream type.
0079   typedef basic_socket_iostream<stream_protocol> iostream;
0080 #endif // !defined(BOOST_ASIO_NO_IOSTREAM)
0081 };
0082 
0083 } // namespace local
0084 } // namespace asio
0085 } // namespace boost
0086 
0087 #include <boost/asio/detail/pop_options.hpp>
0088 
0089 #endif // defined(BOOST_ASIO_HAS_LOCAL_SOCKETS)
0090        //   || defined(GENERATING_DOCUMENTATION)
0091 
0092 #endif // BOOST_ASIO_LOCAL_STREAM_PROTOCOL_HPP