WebSocket client structure.
This structure holds the state and configuration of a WebSocket client, including socket descriptors, connection state, and callback functions.
Note
This structure is managed internally by the SDK. Users should not modify its members directly. Use the provided APIs (e.g., sl_websocket_init, sl_websocket_connect, sl_websocket_deinit) to manage the client lifecycle.
Public Attributes#
BSD socket file descriptor.
WebSocket server host (for example, "example.com").
WebSocket resource path (for example, "/chat").
WebSocket subprotocol (for example, "mqtt").
WebSocket server port number.
Local client port number.
WebSocket server IP address.
Masking key for client-to-server frames (used in hosted mode).
WebSocket connection state.
Data receive callback function.
Callback function for remote termination event.
Enable SSL for WebSocket connection.
Configured TLS version for SSL connections.
User-defined context (for future reference).
Advanced TCP/TLS configuration options.
Flag indicating if advanced TCP/TLS options have been set.
Public Attribute Documentation#
host#
char sl_websocket_client_s::host[SL_SI91X_WEBSOCKET_MAX_HOST_LENGTH]
WebSocket server host (for example, "example.com").
resource#
char sl_websocket_client_s::resource[SL_SI91X_WEBSOCKET_MAX_RESOURCE_LENGTH]
WebSocket resource path (for example, "/chat").
subprotocol#
char sl_websocket_client_s::subprotocol[SLI_WEBS_MAX_SUBPROTOCOL_LENGTH]
WebSocket subprotocol (for example, "mqtt").
mask_key#
uint8_t sl_websocket_client_s::mask_key[4]
Masking key for client-to-server frames (used in hosted mode).
data_cb#
sl_si91x_socket_receive_data_callback_t sl_websocket_client_s::data_cb
Data receive callback function.
remote_terminate_cb#
sl_si91x_socket_remote_termination_callback_t sl_websocket_client_s::remote_terminate_cb
Callback function for remote termination event.
tls_version#
sl_websocket_tls_version_t sl_websocket_client_s::tls_version
Configured TLS version for SSL connections.
tcp_options#
sl_websocket_tcp_tls_advanced_options_t sl_websocket_client_s::tcp_options
Advanced TCP/TLS configuration options.
tcp_options_configured#
bool sl_websocket_client_s::tcp_options_configured
Flag indicating if advanced TCP/TLS options have been set.