Chris@16
|
1 //
|
Chris@16
|
2 // local/stream_protocol.hpp
|
Chris@16
|
3 // ~~~~~~~~~~~~~~~~~~~~~~~~~
|
Chris@16
|
4 //
|
Chris@101
|
5 // Copyright (c) 2003-2015 Christopher M. Kohlhoff (chris at kohlhoff dot com)
|
Chris@16
|
6 //
|
Chris@16
|
7 // Distributed under the Boost Software License, Version 1.0. (See accompanying
|
Chris@16
|
8 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
Chris@16
|
9 //
|
Chris@16
|
10
|
Chris@16
|
11 #ifndef BOOST_ASIO_LOCAL_STREAM_PROTOCOL_HPP
|
Chris@16
|
12 #define BOOST_ASIO_LOCAL_STREAM_PROTOCOL_HPP
|
Chris@16
|
13
|
Chris@16
|
14 #if defined(_MSC_VER) && (_MSC_VER >= 1200)
|
Chris@16
|
15 # pragma once
|
Chris@16
|
16 #endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
|
Chris@16
|
17
|
Chris@16
|
18 #include <boost/asio/detail/config.hpp>
|
Chris@16
|
19
|
Chris@16
|
20 #if defined(BOOST_ASIO_HAS_LOCAL_SOCKETS) \
|
Chris@16
|
21 || defined(GENERATING_DOCUMENTATION)
|
Chris@16
|
22
|
Chris@16
|
23 #include <boost/asio/basic_socket_acceptor.hpp>
|
Chris@16
|
24 #include <boost/asio/basic_socket_iostream.hpp>
|
Chris@16
|
25 #include <boost/asio/basic_stream_socket.hpp>
|
Chris@16
|
26 #include <boost/asio/detail/socket_types.hpp>
|
Chris@16
|
27 #include <boost/asio/local/basic_endpoint.hpp>
|
Chris@16
|
28
|
Chris@16
|
29 #include <boost/asio/detail/push_options.hpp>
|
Chris@16
|
30
|
Chris@16
|
31 namespace boost {
|
Chris@16
|
32 namespace asio {
|
Chris@16
|
33 namespace local {
|
Chris@16
|
34
|
Chris@16
|
35 /// Encapsulates the flags needed for stream-oriented UNIX sockets.
|
Chris@16
|
36 /**
|
Chris@16
|
37 * The boost::asio::local::stream_protocol class contains flags necessary for
|
Chris@16
|
38 * stream-oriented UNIX domain sockets.
|
Chris@16
|
39 *
|
Chris@16
|
40 * @par Thread Safety
|
Chris@16
|
41 * @e Distinct @e objects: Safe.@n
|
Chris@16
|
42 * @e Shared @e objects: Safe.
|
Chris@16
|
43 *
|
Chris@16
|
44 * @par Concepts:
|
Chris@16
|
45 * Protocol.
|
Chris@16
|
46 */
|
Chris@16
|
47 class stream_protocol
|
Chris@16
|
48 {
|
Chris@16
|
49 public:
|
Chris@16
|
50 /// Obtain an identifier for the type of the protocol.
|
Chris@16
|
51 int type() const
|
Chris@16
|
52 {
|
Chris@16
|
53 return SOCK_STREAM;
|
Chris@16
|
54 }
|
Chris@16
|
55
|
Chris@16
|
56 /// Obtain an identifier for the protocol.
|
Chris@16
|
57 int protocol() const
|
Chris@16
|
58 {
|
Chris@16
|
59 return 0;
|
Chris@16
|
60 }
|
Chris@16
|
61
|
Chris@16
|
62 /// Obtain an identifier for the protocol family.
|
Chris@16
|
63 int family() const
|
Chris@16
|
64 {
|
Chris@16
|
65 return AF_UNIX;
|
Chris@16
|
66 }
|
Chris@16
|
67
|
Chris@16
|
68 /// The type of a UNIX domain endpoint.
|
Chris@16
|
69 typedef basic_endpoint<stream_protocol> endpoint;
|
Chris@16
|
70
|
Chris@16
|
71 /// The UNIX domain socket type.
|
Chris@16
|
72 typedef basic_stream_socket<stream_protocol> socket;
|
Chris@16
|
73
|
Chris@16
|
74 /// The UNIX domain acceptor type.
|
Chris@16
|
75 typedef basic_socket_acceptor<stream_protocol> acceptor;
|
Chris@16
|
76
|
Chris@16
|
77 #if !defined(BOOST_ASIO_NO_IOSTREAM)
|
Chris@16
|
78 /// The UNIX domain iostream type.
|
Chris@16
|
79 typedef basic_socket_iostream<stream_protocol> iostream;
|
Chris@16
|
80 #endif // !defined(BOOST_ASIO_NO_IOSTREAM)
|
Chris@16
|
81 };
|
Chris@16
|
82
|
Chris@16
|
83 } // namespace local
|
Chris@16
|
84 } // namespace asio
|
Chris@16
|
85 } // namespace boost
|
Chris@16
|
86
|
Chris@16
|
87 #include <boost/asio/detail/pop_options.hpp>
|
Chris@16
|
88
|
Chris@16
|
89 #endif // defined(BOOST_ASIO_HAS_LOCAL_SOCKETS)
|
Chris@16
|
90 // || defined(GENERATING_DOCUMENTATION)
|
Chris@16
|
91
|
Chris@16
|
92 #endif // BOOST_ASIO_LOCAL_STREAM_PROTOCOL_HPP
|