Skip to content

Commit

Permalink
docs(websocket): improve websocket event list
Browse files Browse the repository at this point in the history
  • Loading branch information
bryghtlabs-richard committed Aug 16, 2024
1 parent a8f13bc commit 9cf4163
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions docs/esp_websocket_client/en/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,12 @@ For more options on :cpp:type:`esp_websocket_client_config_t`, please refer to A

Events
------
* `WEBSOCKET_EVENT_BEFORE_CONNECT`: The client is about to connect.
* `WEBSOCKET_EVENT_CONNECTED`: The client has successfully established a connection to the server. The client is now ready to send and receive data. Contains no event data.
* `WEBSOCKET_EVENT_DISCONNECTED`: The client has aborted the connection due to the transport layer failing to read data, e.g. because the server is unavailable. Contains no event data.
* `WEBSOCKET_EVENT_DATA`: The client has successfully received and parsed a WebSocket frame. The event data contains a pointer to the payload data, the length of the payload data as well as the opcode of the received frame. A message may be fragmented into multiple events if the length exceeds the buffer size. This event will also be posted for non-payload frames, e.g. pong or connection close frames.
* `WEBSOCKET_EVENT_ERROR`: Not used in the current implementation of the client.
* `WEBSOCKET_EVENT_ERROR`: The client has experienced an error. Examples include transport write or read failures.
* `WEBSOCKET_EVENT_DISCONNECTED`: The client has aborted the connection due to the transport layer failing to read data, e.g. because the server is unavailable. Contains no event data.
* `WEBSOCKET_EVENT_CLOSED`: The connection has been closed cleanly.

If the client handle is needed in the event handler it can be accessed through the pointer passed to the event handler:

Expand Down

0 comments on commit 9cf4163

Please sign in to comment.