Skip to content

Commit 9cf4163

Browse files
docs(websocket): improve websocket event list
1 parent a8f13bc commit 9cf4163

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

docs/esp_websocket_client/en/index.rst

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,10 +91,12 @@ For more options on :cpp:type:`esp_websocket_client_config_t`, please refer to A
9191

9292
Events
9393
------
94+
* `WEBSOCKET_EVENT_BEFORE_CONNECT`: The client is about to connect.
9495
* `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.
95-
* `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.
9696
* `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.
97-
* `WEBSOCKET_EVENT_ERROR`: Not used in the current implementation of the client.
97+
* `WEBSOCKET_EVENT_ERROR`: The client has experienced an error. Examples include transport write or read failures.
98+
* `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.
99+
* `WEBSOCKET_EVENT_CLOSED`: The connection has been closed cleanly.
98100

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

0 commit comments

Comments
 (0)