mirror of
https://github.com/espressif/esp-protocols.git
synced 2025-07-14 02:56:33 +02:00
tcp_transport: Added internal API for underlying socket, used for custom select on connection end for WS
Internal tcp_transport functions could now use custom socket operations. This is used for WebSocket transport, when we typically wait for clean connection closure, i.e. selecting for read/error with expected errno or recv size=0 while socket readable (=connection terminated by FIN flag) * Original commit: espressif/esp-idf@5e9f8b52e7
This commit is contained in:
@ -40,6 +40,7 @@ typedef enum {
|
||||
WEBSOCKET_EVENT_CONNECTED, /*!< Once the Websocket has been connected to the server, no data exchange has been performed */
|
||||
WEBSOCKET_EVENT_DISCONNECTED, /*!< The connection has been disconnected */
|
||||
WEBSOCKET_EVENT_DATA, /*!< When receiving data from the server, possibly multiple portions of the packet */
|
||||
WEBSOCKET_EVENT_CLOSED, /*!< The connection has been closed cleanly */
|
||||
WEBSOCKET_EVENT_MAX
|
||||
} esp_websocket_event_id_t;
|
||||
|
||||
@ -125,7 +126,11 @@ esp_err_t esp_websocket_client_set_uri(esp_websocket_client_handle_t client, con
|
||||
esp_err_t esp_websocket_client_start(esp_websocket_client_handle_t client);
|
||||
|
||||
/**
|
||||
* @brief Close the WebSocket connection
|
||||
* @brief Stops the WebSocket connection without websocket closing handshake
|
||||
*
|
||||
* This API stops ws client and closes TCP connection directly without sending
|
||||
* close frames. It is a good practice to close the connection in a clean way
|
||||
* using esp_websocket_client_close().
|
||||
*
|
||||
* @param[in] client The client
|
||||
*
|
||||
|
Reference in New Issue
Block a user