Struct SYN_WebsocketSession¶
ClassList > SYN_WebsocketSession
WebSocket session context.
#include <syn_websocket.h>
Public Attributes¶
| Type | Name |
|---|---|
| uint32_t | bytes_read |
| void * | ctx |
| uint8_t | mask_key |
| bool | masked |
| void(* | on_message User callback invoked when a complete frame is received. |
| uint8_t | opcode |
| uint32_t | payload_len |
| uint8_t | rx_buf |
| uint8_t | rx_state |
| SYN_Socket | sock |
| SYN_WebsocketState | state |
Public Attributes Documentation¶
variable bytes_read¶
Accumulated payload bytes read so far
variable ctx¶
User context pointer for message callback
variable mask_key¶
Client-to-server frame masking key
variable masked¶
True if the incoming frame is masked
variable on_message¶
User callback invoked when a complete frame is received.
void(* SYN_WebsocketSession::on_message) (const uint8_t *payload, size_t len, uint8_t opcode, void *ctx);
Parameters:
payloadReceived frame data.lenFrame length in bytes.opcodeFrame type opcode.ctxUser context pointer.
variable opcode¶
WebSocket opcode (e.g. text, binary, close, ping)
variable payload_len¶
Size of the current incoming frame payload
variable rx_buf¶
Payload receive packet storage
variable rx_state¶
Frame parsing state: 0=header, 1=length, 2=mask, 3=payload
variable sock¶
Network socket handle
variable state¶
WebSocket connection state
The documentation for this class was generated from the following file src/syntropic/net/syn_websocket.h