diff --git a/components/esp_websocket_client/esp_websocket_client.c b/components/esp_websocket_client/esp_websocket_client.c index f943a86895..4c78eab9ff 100644 --- a/components/esp_websocket_client/esp_websocket_client.c +++ b/components/esp_websocket_client/esp_websocket_client.c @@ -235,9 +235,9 @@ static esp_err_t esp_websocket_client_abort_connection(esp_websocket_client_hand } else { client->reconnect_tick_ms = _tick_get_ms(); ESP_LOGI(TAG, "Reconnect after %d ms", client->wait_timeout_ms); - client->error_handle.error_type = error_type; client->state = WEBSOCKET_STATE_WAIT_TIMEOUT; } + client->error_handle.error_type = error_type; esp_websocket_client_dispatch_event(client, WEBSOCKET_EVENT_DISCONNECTED, NULL, 0); return ESP_OK; }