Constants#
This section provides a reference to the WebSocket Client API constants.
Enumerations#
WebSocket opcodes for different frame types.
Error codes for WebSocket operations.
WebSocket connection states.
WebSocket predefined status codes for Close frames.
Macros#
Final frame bit.
Websocket max host length.
Websocket max resource length.
Enumeration Documentation#
sl_websocket_opcode_t#
sl_websocket_opcode_t
WebSocket opcodes for different frame types.
This enumeration defines the opcodes used in WebSocket frames to indicate the type of frame being sent or received.
| Enumerator | |
|---|---|
| SL_WEBSOCKET_OPCODE_CONTINUE | Continuation frame.  | 
| SL_WEBSOCKET_OPCODE_TEXT | Text frame.  | 
| SL_WEBSOCKET_OPCODE_BINARY | Binary frame.  | 
| SL_WEBSOCKET_OPCODE_CLOSE | Connection close frame.  | 
| SL_WEBSOCKET_OPCODE_PING | Ping frame.  | 
| SL_WEBSOCKET_OPCODE_PONG | Pong frame.  | 
sl_websocket_error_t#
sl_websocket_error_t
Error codes for WebSocket operations.
This enumeration defines the error codes that can be returned by WebSocket operations to indicate the result of the operation.
| Enumerator | |
|---|---|
| SL_WEBSOCKET_SUCCESS | Operation successful.  | 
| SL_WEBSOCKET_ERR_SOCKET_CREATION | Error creating socket.  | 
| SL_WEBSOCKET_ERR_SOCKET_BIND | Error binding socket.  | 
| SL_WEBSOCKET_ERR_SOCKET_CONNECT | Error connecting socket.  | 
| SL_WEBSOCKET_ERR_SEND_FRAME | Error sending frame.  | 
| SL_WEBSOCKET_ERR_RECEIVE_FRAME | Error receiving frame.  | 
| SL_WEBSOCKET_ERR_CLOSE_FRAME | Error closing frame.  | 
| SL_WEBSOCKET_ERR_SSL_SETSOCKOPT | Error setting socket options for SSL.  | 
| SL_WEBSOCKET_ERR_INVALID_PARAMETER | Invalid input parameter.  | 
sl_websocket_state_t#
sl_websocket_state_t
WebSocket connection states.
This enumeration defines the possible states of a WebSocket connection.
| Enumerator | |
|---|---|
| SL_WEBSOCKET_STATE_DISCONNECTED | The WebSocket client is not connected to the server.  | 
| SL_WEBSOCKET_STATE_CONNECTING | The WebSocket client is in the process of establishing a connection to the server.  | 
| SL_WEBSOCKET_STATE_CONNECTED | The WebSocket client is successfully connected to the server.  | 
| SL_WEBSOCKET_STATE_CLOSING | The WebSocket client is in the process of closing the connection.  | 
| SL_WEBSOCKET_STATE_CLOSED | The WebSocket connection has been closed.  | 
sl_websocket_close_status_code_t#
sl_websocket_close_status_code_t
WebSocket predefined status codes for Close frames.
This enumeration defines the pre-defined status codes that endpoints may use when sending a Close frame.
| Enumerator | |
|---|---|
| SL_WEBSOCKET_CLOSE_NORMAL | Normal closure.  | 
| SL_WEBSOCKET_CLOSE_GOING_AWAY | Endpoint is going away.  | 
| SL_WEBSOCKET_CLOSE_PROTOCOL_ERROR | Protocol error.  | 
| SL_WEBSOCKET_CLOSE_UNSUPPORTED_DATA | Received data type not supported.  | 
| SL_WEBSOCKET_CLOSE_RESERVED | Reserved.  | 
| SL_WEBSOCKET_CLOSE_NO_STATUS | No status code present.  | 
| SL_WEBSOCKET_CLOSE_ABNORMAL | Abnormal closure.  | 
| SL_WEBSOCKET_CLOSE_INVALID_PAYLOAD | Invalid payload data.  | 
| SL_WEBSOCKET_CLOSE_POLICY_VIOLATION | Policy violation.  | 
| SL_WEBSOCKET_CLOSE_MESSAGE_TOO_BIG | Message too big.  | 
| SL_WEBSOCKET_CLOSE_MISSING_EXTENSION | Missing required extension.  | 
| SL_WEBSOCKET_CLOSE_INTERNAL_ERROR | Internal server error.  | 
| SL_WEBSOCKET_CLOSE_TLS_HANDSHAKE_FAILURE | TLS handshake failure.  |