File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed
components/esp_websocket_client Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -1071,12 +1071,6 @@ static void esp_websocket_client_task(void *pv)
10711071 break ;
10721072 }
10731073 client -> ping_tick_ms = _tick_get_ms ();
1074-
1075- if (esp_websocket_client_recv (client ) == ESP_FAIL ) {
1076- ESP_LOGE (TAG , "Error receive data" );
1077- esp_websocket_client_abort_connection (client , WEBSOCKET_ERROR_TYPE_TCP_TRANSPORT );
1078- break ;
1079- }
10801074 break ;
10811075 case WEBSOCKET_STATE_WAIT_TIMEOUT :
10821076
@@ -1113,6 +1107,13 @@ static void esp_websocket_client_task(void *pv)
11131107 xSemaphoreTakeRecursive (client -> lock , lock_timeout );
11141108 esp_websocket_client_abort_connection (client , WEBSOCKET_ERROR_TYPE_TCP_TRANSPORT );
11151109 xSemaphoreGiveRecursive (client -> lock );
1110+ } else if (read_select > 0 ) {
1111+ if (esp_websocket_client_recv (client ) == ESP_FAIL ) {
1112+ ESP_LOGE (TAG , "Error receive data" );
1113+ xSemaphoreTakeRecursive (client -> lock , lock_timeout );
1114+ esp_websocket_client_abort_connection (client , WEBSOCKET_ERROR_TYPE_TCP_TRANSPORT );
1115+ xSemaphoreGiveRecursive (client -> lock );
1116+ }
11161117 }
11171118 } else if (WEBSOCKET_STATE_WAIT_TIMEOUT == client -> state ) {
11181119 // waiting for reconnecting...
You can’t perform that action at this time.
0 commit comments