mirror of
https://github.com/espressif/esp-protocols.git
synced 2025-07-15 19:42:09 +02:00
feat(websocket): allow updating reconnect timeout for retry backoffs
This commit is contained in:
@ -416,6 +416,29 @@ size_t esp_websocket_client_get_ping_interval_sec(esp_websocket_client_handle_t
|
||||
*/
|
||||
esp_err_t esp_websocket_client_set_ping_interval_sec(esp_websocket_client_handle_t client, size_t ping_interval_sec);
|
||||
|
||||
/**
|
||||
* @brief Get the next reconnect timeout for client. Returns -1 when client is not initialized or automatic reconnect is disabled.
|
||||
*
|
||||
* @param[in] client The client
|
||||
*
|
||||
* @return Reconnect timeout in msec
|
||||
*/
|
||||
int esp_websocket_client_get_reconnect_timeout(esp_websocket_client_handle_t client);
|
||||
|
||||
/**
|
||||
* @brief Set next reconnect timeout for client.
|
||||
*
|
||||
* Notes:
|
||||
* - Changing this value when reconnection delay is already active does not immediately affect the active delay and may have unexpected result.
|
||||
* - Good place to change this value is when handling WEBSOCKET_EVENT_DISCONNECTED or WEBSOCKET_EVENT_ERROR events.
|
||||
*
|
||||
* @param[in] client The client
|
||||
* @param[in] reconnect_timeout_ms The new timeout
|
||||
*
|
||||
* @return esp_err_t
|
||||
*/
|
||||
esp_err_t esp_websocket_client_set_reconnect_timeout(esp_websocket_client_handle_t client, int reconnect_timeout_ms);
|
||||
|
||||
/**
|
||||
* @brief Register the Websocket Events
|
||||
*
|
||||
|
Reference in New Issue
Block a user