5 Struct N_WS_FRAME
gullradriel edited this page 2026-10-09 00:55:18 +02:00

N_WS_FRAME

Module: NETWORK ENGINE: connect, accept, send and recv wrappers. Network Queue, thread-safe add/get message, ssl/tls secured communications

A single parsed WebSocket frame (RFC 6455). More...

#include "n_network.h"

Public Attributes

Name
int rsv
the three reserved bits, rsv1<<2
uint64_t payload_len
payload length in bytes
const unsigned char * payload
pointer into the input buffer (still masked)
int opcode
opcode (N_WS_OP_*)
int masked
MASK bit (client-to-server frames are masked).
unsigned char[4] mask
masking key when masked, else zeroed
int fin
FIN bit (1 = final fragment).

Detailed Description

struct N_WS_FRAME;

A single parsed WebSocket frame (RFC 6455).

payload points into the parsed buffer and is still masked when masked is set; use n_ws_unmask to decode it.

Public Attributes Documentation

variable rsv

int rsv;

the three reserved bits, rsv1<<2 | rsv2<<1 | rsv3

variable payload_len

uint64_t payload_len;

payload length in bytes

variable payload

const unsigned char * payload;

pointer into the input buffer (still masked)

variable opcode

int opcode;

opcode (N_WS_OP_*)

variable masked

int masked;

MASK bit (client-to-server frames are masked).

variable mask

unsigned char[4] mask;

masking key when masked, else zeroed

variable fin

int fin;

FIN bit (1 = final fragment).