]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/boost/beast/websocket/role.hpp
update sources to v12.2.3
[ceph.git] / ceph / src / boost / boost / beast / websocket / role.hpp
1 //
2 // Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com)
3 //
4 // Distributed under the Boost Software License, Version 1.0. (See accompanying
5 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
6 //
7 // Official repository: https://github.com/boostorg/beast
8 //
9
10 #ifndef BOOST_BEAST_WEBSOCKET_ROLE_HPP
11 #define BOOST_BEAST_WEBSOCKET_ROLE_HPP
12
13 #include <boost/beast/core/detail/config.hpp>
14
15 namespace boost {
16 namespace beast {
17 namespace websocket {
18
19 /** The role of the websocket stream endpoint.
20
21 Whether the endpoint is a client or server affects the
22 behavior of the <em>Close the WebSocket Connection</em>
23 operation described in rfc6455 section 7.1.1.
24 The shutdown behavior depends on the type of the next
25 layer template parameter used to construct the @ref stream.
26 Other next layer types including user-defined types
27 may implement different role-based behavior when
28 performing the close operation.
29
30 The default implementation for @ref stream when the next
31 layer type is a `boost::asio::ip::tcp::socket` behaves
32 as follows:
33
34 @li In the client role, a TCP/IP shutdown is sent after
35 reading all remaining data on the connection.
36
37 @li In the server role, a TCP/IP shutdown is sent before
38 reading all remaining data on the connection.
39
40 When the next layer type is a `boost::asio::ssl::stream`,
41 the connection is closed by performing the SSL closing
42 handshake corresponding to the role type, client or server.
43
44 @see https://tools.ietf.org/html/rfc6455#section-7.1.1
45 */
46 enum class role_type
47 {
48 /// The stream is operating as a client.
49 client,
50
51 /// The stream is operating as a server.
52 server
53 };
54
55 } // websocket
56 } // beast
57 } // boost
58
59 #endif