mirror of
https://github.com/espressif/esp-protocols.git
synced 2025-07-16 20:12:13 +02:00
fix(websocket): Close websocket and dispatch event if server does not close within a reasonable amount of time.
This commit is contained in:
@ -1039,10 +1039,9 @@ static void esp_websocket_client_task(void *pv)
|
|||||||
ESP_LOGD(TAG, " Waiting for TCP connection to be closed by the server");
|
ESP_LOGD(TAG, " Waiting for TCP connection to be closed by the server");
|
||||||
int ret = esp_transport_ws_poll_connection_closed(client->transport, 1000);
|
int ret = esp_transport_ws_poll_connection_closed(client->transport, 1000);
|
||||||
if (ret == 0) {
|
if (ret == 0) {
|
||||||
// still waiting
|
ESP_LOGW(TAG, "Did not get TCP close within expected delay");
|
||||||
continue;
|
|
||||||
}
|
} else if (ret < 0) {
|
||||||
if (ret < 0) {
|
|
||||||
ESP_LOGW(TAG, "Connection terminated while waiting for clean TCP close");
|
ESP_LOGW(TAG, "Connection terminated while waiting for clean TCP close");
|
||||||
}
|
}
|
||||||
client->run = false;
|
client->run = false;
|
||||||
|
Reference in New Issue
Block a user