Back to home page

EIC code displayed by LXR

 
 

    


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

0001 //
0002 // local/seq_packet_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_SEQ_PACKET_PROTOCOL_HPP
0012 #define BOOST_ASIO_LOCAL_SEQ_PACKET_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_seq_packet_socket.hpp>
0025 #include <boost/asio/detail/socket_types.hpp>
0026 #include <boost/asio/local/basic_endpoint.hpp>
0027 
0028 #include <boost/asio/detail/push_options.hpp>
0029 
0030 namespace boost {
0031 namespace asio {
0032 namespace local {
0033 
0034 /// Encapsulates the flags needed for seq_packet UNIX sockets.
0035 /**
0036  * The boost::asio::local::seq_packet_protocol class contains flags necessary
0037  * for sequenced packet UNIX domain sockets.
0038  *
0039  * @par Thread Safety
0040  * @e Distinct @e objects: Safe.@n
0041  * @e Shared @e objects: Safe.
0042  *
0043  * @par Concepts:
0044  * Protocol.
0045  */
0046 class seq_packet_protocol
0047 {
0048 public:
0049   /// Obtain an identifier for the type of the protocol.
0050   int type() const noexcept
0051   {
0052     return SOCK_SEQPACKET;
0053   }
0054 
0055   /// Obtain an identifier for the protocol.
0056   int protocol() const noexcept
0057   {
0058     return 0;
0059   }
0060 
0061   /// Obtain an identifier for the protocol family.
0062   int family() const noexcept
0063   {
0064     return AF_UNIX;
0065   }
0066 
0067   /// The type of a UNIX domain endpoint.
0068   typedef basic_endpoint<seq_packet_protocol> endpoint;
0069 
0070   /// The UNIX domain socket type.
0071   typedef basic_seq_packet_socket<seq_packet_protocol> socket;
0072 
0073   /// The UNIX domain acceptor type.
0074   typedef basic_socket_acceptor<seq_packet_protocol> acceptor;
0075 };
0076 
0077 } // namespace local
0078 } // namespace asio
0079 } // namespace boost
0080 
0081 #include <boost/asio/detail/pop_options.hpp>
0082 
0083 #endif // defined(BOOST_ASIO_HAS_LOCAL_SOCKETS)
0084        //   || defined(GENERATING_DOCUMENTATION)
0085 
0086 #endif // BOOST_ASIO_LOCAL_SEQ_PACKET_PROTOCOL_HPP