NetBurner 3.5.8
PDF Version
Web Socket Definitions

WebSocket Protocol Implementation for Real-Time Bidirectional Communication #include< websockets.h>
. More...

Macros

#define WS_BUFFER_SEGMENTS   4
 Number of buffer segments per WebSocket connection (RX, TX, Control buffers).
#define WS_BUFFER_MIN   10
 Minimum buffer space threshold (bytes) before triggering flush/block.
#define WS_ACCUM_DLY   ((TICKS_PER_SECOND / 4) + 1)
 Accumulation delay (ticks) for batching small writes (~250ms).
#define WS_FLUSH_TIMEOUT   0
 Flush operation timeout in ticks (0 = non-blocking).
#define WS_FIN_BIT   0x80
 Frame FIN bit (0x80) indicating final fragment of message.
#define WS_OP_CONT   0x0
 WebSocket continuation frame opcode for message fragments.
#define WS_OP_TEXT   0x1
 WebSocket text frame opcode for UTF-8 encoded text data.
#define WS_OP_BIN   0x2
 WebSocket binary frame opcode for raw binary data.
#define WS_OP_CLOSE   0x8
 WebSocket close frame opcode for graceful connection termination.
#define WS_OP_PING   0x9
 WebSocket ping frame opcode for connection liveness check.
#define WS_OP_PONG   0xA
 WebSocket pong frame opcode for ping response.
#define WS_SO_TEXT   0x8
 Socket option flag to enable text frame mode (vs binary mode).

Detailed Description

WebSocket Protocol Implementation for Real-Time Bidirectional Communication #include< websockets.h>
.

Overview

The NetBurner WebSocket implementation provides full-duplex communication channels over a single TCP connection, enabling real-time data exchange between clients and servers. WebSockets upgrade from HTTP connections and maintain persistent connections for efficient, low-latency bidirectional messaging.

Key features include:

  • RFC 6455 compliant WebSocket protocol implementation
  • Automatic connection upgrade from HTTP to WebSocket
  • Support for text and binary data frames
  • Built-in ping/pong for connection health monitoring
  • Efficient buffering and flow control
  • Support for both client and server roles
  • Graceful connection closure with status codes
  • Frame fragmentation for large messages
Note
See detailed information in the Programmers Guide Web Sockets

Defines for configuration, status and error codes.

Note
See detailed information in the Programmers Guide Web Sockets Definitions