userver
C++ Async Framework
Loading...
Searching...
No Matches
message.hpp
Go to the documentation of this file.
1
#
pragma
once
2
3
/// @file userver/websocket/message.hpp
4
/// @brief @copybrief websocket::Message
5
6
#
include
<
optional
>
7
#
include
<
string
>
8
9
USERVER_NAMESPACE_BEGIN
10
11
namespace
websocket {
12
13
using
CloseStatusInt = int16_t;
14
15
/// @brief Close statuses
16
enum
class
CloseStatus
:
CloseStatusInt
{
17
kNone = 0,
18
19
kNormal = 1000,
20
kGoingAway = 1001,
21
kProtocolError = 1002,
22
kUnsupportedData = 1003,
23
kFrameTooLarge = 1004,
24
kNoStatusRcvd = 1005,
25
kAbnormalClosure = 1006,
26
kBadMessageData = 1007,
27
kPolicyViolation = 1008,
28
kTooBigData = 1009,
29
kExtensionMismatch = 1010,
30
kServerError = 1011
31
};
32
33
/// @brief WebSocket message
34
struct
Message
{
35
std::string
data
;
///< payload
36
std::optional<
CloseStatus
>
close_status
= {};
///< close status
37
bool
is_text
=
false
;
///< is it text or binary?
38
};
39
40
}
// namespace websocket
41
42
USERVER_NAMESPACE_END
userver
websocket
message.hpp
Generated on Mon Mar 23 2026 21:43:33 for userver by
Doxygen
1.13.2