websocket: add configurable timeout for PONG not received

Closes IDF-1744


* Original commit: espressif/esp-idf@0049385850
This commit is contained in:
Marius Vikhammer
2020-05-22 20:34:20 +08:00
committed by gabsuren
parent f8e3ba7813
commit b71c49c277
2 changed files with 34 additions and 1 deletions

View File

@ -85,6 +85,9 @@ typedef struct {
char *subprotocol; /*!< Websocket subprotocol */
char *user_agent; /*!< Websocket user-agent */
char *headers; /*!< Websocket additional headers */
int pingpong_timeout_sec; /*!< Period before connection is aborted due to no PONGs received */
bool disable_pingpong_discon; /*!< Disable auto-disconnect due to no PONG received within pingpong_timeout_sec */
} esp_websocket_client_config_t;
/**
@ -185,7 +188,7 @@ int esp_websocket_client_send_bin(esp_websocket_client_handle_t client, const ch
int esp_websocket_client_send_text(esp_websocket_client_handle_t client, const char *data, int len, TickType_t timeout);
/**
* @brief Check the WebSocket connection status
* @brief Check the WebSocket client connection state
*
* @param[in] client The client handle
*