mirror of
https://github.com/espressif/esp-protocols.git
synced 2025-07-14 02:56:33 +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");
|
||||
int ret = esp_transport_ws_poll_connection_closed(client->transport, 1000);
|
||||
if (ret == 0) {
|
||||
// still waiting
|
||||
continue;
|
||||
}
|
||||
if (ret < 0) {
|
||||
ESP_LOGW(TAG, "Did not get TCP close within expected delay");
|
||||
|
||||
} else if (ret < 0) {
|
||||
ESP_LOGW(TAG, "Connection terminated while waiting for clean TCP close");
|
||||
}
|
||||
client->run = false;
|
||||
|
Reference in New Issue
Block a user