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)
1071
1071
break ;
1072
1072
}
1073
1073
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
- }
1080
1074
break ;
1081
1075
case WEBSOCKET_STATE_WAIT_TIMEOUT :
1082
1076
@@ -1113,6 +1107,13 @@ static void esp_websocket_client_task(void *pv)
1113
1107
xSemaphoreTakeRecursive (client -> lock , lock_timeout );
1114
1108
esp_websocket_client_abort_connection (client , WEBSOCKET_ERROR_TYPE_TCP_TRANSPORT );
1115
1109
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
+ }
1116
1117
}
1117
1118
} else if (WEBSOCKET_STATE_WAIT_TIMEOUT == client -> state ) {
1118
1119
// waiting for reconnecting...
You can’t perform that action at this time.
0 commit comments