Chris@16
|
1 //
|
Chris@16
|
2 // local/datagram_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_DATAGRAM_PROTOCOL_HPP
|
Chris@16
|
12 #define BOOST_ASIO_LOCAL_DATAGRAM_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_datagram_socket.hpp>
|
Chris@16
|
24 #include <boost/asio/detail/socket_types.hpp>
|
Chris@16
|
25 #include <boost/asio/local/basic_endpoint.hpp>
|
Chris@16
|
26
|
Chris@16
|
27 #include <boost/asio/detail/push_options.hpp>
|
Chris@16
|
28
|
Chris@16
|
29 namespace boost {
|
Chris@16
|
30 namespace asio {
|
Chris@16
|
31 namespace local {
|
Chris@16
|
32
|
Chris@16
|
33 /// Encapsulates the flags needed for datagram-oriented UNIX sockets.
|
Chris@16
|
34 /**
|
Chris@16
|
35 * The boost::asio::local::datagram_protocol class contains flags necessary for
|
Chris@16
|
36 * datagram-oriented UNIX domain sockets.
|
Chris@16
|
37 *
|
Chris@16
|
38 * @par Thread Safety
|
Chris@16
|
39 * @e Distinct @e objects: Safe.@n
|
Chris@16
|
40 * @e Shared @e objects: Safe.
|
Chris@16
|
41 *
|
Chris@16
|
42 * @par Concepts:
|
Chris@16
|
43 * Protocol.
|
Chris@16
|
44 */
|
Chris@16
|
45 class datagram_protocol
|
Chris@16
|
46 {
|
Chris@16
|
47 public:
|
Chris@16
|
48 /// Obtain an identifier for the type of the protocol.
|
Chris@16
|
49 int type() const
|
Chris@16
|
50 {
|
Chris@16
|
51 return SOCK_DGRAM;
|
Chris@16
|
52 }
|
Chris@16
|
53
|
Chris@16
|
54 /// Obtain an identifier for the protocol.
|
Chris@16
|
55 int protocol() const
|
Chris@16
|
56 {
|
Chris@16
|
57 return 0;
|
Chris@16
|
58 }
|
Chris@16
|
59
|
Chris@16
|
60 /// Obtain an identifier for the protocol family.
|
Chris@16
|
61 int family() const
|
Chris@16
|
62 {
|
Chris@16
|
63 return AF_UNIX;
|
Chris@16
|
64 }
|
Chris@16
|
65
|
Chris@16
|
66 /// The type of a UNIX domain endpoint.
|
Chris@16
|
67 typedef basic_endpoint<datagram_protocol> endpoint;
|
Chris@16
|
68
|
Chris@16
|
69 /// The UNIX domain socket type.
|
Chris@16
|
70 typedef basic_datagram_socket<datagram_protocol> socket;
|
Chris@16
|
71 };
|
Chris@16
|
72
|
Chris@16
|
73 } // namespace local
|
Chris@16
|
74 } // namespace asio
|
Chris@16
|
75 } // namespace boost
|
Chris@16
|
76
|
Chris@16
|
77 #include <boost/asio/detail/pop_options.hpp>
|
Chris@16
|
78
|
Chris@16
|
79 #endif // defined(BOOST_ASIO_HAS_LOCAL_SOCKETS)
|
Chris@16
|
80 // || defined(GENERATING_DOCUMENTATION)
|
Chris@16
|
81
|
Chris@16
|
82 #endif // BOOST_ASIO_LOCAL_DATAGRAM_PROTOCOL_HPP
|