WebSocket framing, handshakes, and connection helpers.
| Name | Description |
|---|---|
ConnectionAdapter | WebSocket class which belongs to an HTTP connection. |
WebSocket | Standalone WebSocket class. |
WebSocketAdapter | WebSocket protocol adapter for both client and server endpoints. |
WebSocketException | |
WebSocketFramer | WebSocket frame encoder/decoder and handshake validator for RFC 6455. |
| Name | Description |
|---|---|
Mode | WebSocket endpoint mode. |
FrameFlags | Frame header flags. |
Opcode | Frame header opcodes. |
SendFlags | Combined header flags and opcodes for identifying the payload type of sent frames. |
CloseStatusCode | StatusCodes for CLOSE frames sent with shutdown(). |
ErrorCode | These error codes can be obtained from WebSocket exceptions to determine the exact cause of the error. |
CloseState |
enum ModeWebSocket endpoint mode.
enum FrameFlagsFrame header flags.
| Value | Description |
|---|---|
Fin | FIN bit: final fragment of a multi-fragment message. |
Rsv1 | Reserved for future use. Must be zero. |
Rsv2 | Reserved for future use. Must be zero. |
Rsv3 | Reserved for future use. Must be zero. |
enum OpcodeFrame header opcodes.
| Value | Description |
|---|---|
Continuation | Continuation frame. |
Text | Text frame. |
Binary | Binary frame. |
Close | Close connection. |
Ping | Ping frame. |
Pong | Pong frame. |
Bitmask | Bit mask for opcodes. |
enum SendFlagsCombined header flags and opcodes for identifying the payload type of sent frames.
| Value | Description |
|---|---|
Text | |
Binary |
enum CloseStatusCodeStatusCodes for CLOSE frames sent with shutdown().
| Value | Description |
|---|---|
NormalClose | |
EndpointGoingAway | |
ProtocolError | |
PayloadNotAcceptable | |
Reserved | |
ReservedNoStatusCode | |
ReservedAbnormalClose | |
MalformedPayload | |
PolicyViolation | |
PayloadTooBig | |
ExtensionRequired | |
UnexpectedCondition | |
ReservedTLSFailure |
enum ErrorCodeThese error codes can be obtained from WebSocket exceptions to determine the exact cause of the error.
| Value | Description |
|---|---|
NoHandshake | No Connection: Upgrade or Upgrade: websocket header in handshake request. |
HandshakeNoVersion | No Sec-WebSocket-Version header in handshake request. |
HandshakeUnsupportedVersion | Unsupported WebSocket version requested by client. |
HandshakeNoKey | No Sec-WebSocket-Key header in handshake request. |
HandshakeAccept | No Sec-WebSocket-Accept header or wrong value. |
Unauthorized | The server rejected the username or password for authentication. |
PayloadTooBig | Payload too big for supplied buffer. |
IncompleteFrame | Incomplete frame received. |
InvalidRsvBits | RSV bits set without extension negotiation. |
InvalidOpcode | Unknown or reserved opcode received. |
UnmaskedClientFrame | Client-to-server frame not masked (RFC 6455 violation). |
ProtocolViolation | General RFC 6455 protocol violation. |
enum CloseState| Value | Description |
|---|---|
Open | |
CloseSent | |
CloseReceived | |
Closed |
| Return | Name | Description |
|---|---|---|
constexpr auto | ServerSide static | |
constexpr auto | ClientSide static | |
constexpr char | ProtocolGuid | |
constexpr char | ProtocolVersion | The WebSocket protocol version supported (13). |
static
constexpr auto ServerSide = Mode::ServerSidestatic
constexpr auto ClientSide = Mode::ClientSideconstexpr char ProtocolGuid = "258EAFA5-E914-47DA-95CA-C5AB0DC85B11"constexpr char ProtocolVersion = "13"The WebSocket protocol version supported (13).