Merge pull request #633 from bryghtlabs-richard/feat/websocketBeginEnd

Feat/websocket: begin end thread events (IDFGH-13507)
This commit is contained in:
david-cermak
2024-08-20 16:41:52 +02:00
committed by GitHub
5 changed files with 22 additions and 2 deletions

View File

@ -972,6 +972,7 @@ static void esp_websocket_client_task(void *pv)
client->state = WEBSOCKET_STATE_INIT;
xEventGroupClearBits(client->status_bits, STOPPED_BIT | CLOSE_FRAME_SENT_BIT);
esp_websocket_client_dispatch_event(client, WEBSOCKET_EVENT_BEGIN, NULL, 0);
int read_select = 0;
while (client->run) {
if (xSemaphoreTakeRecursive(client->lock, lock_timeout) != pdPASS) {
@ -1106,6 +1107,7 @@ static void esp_websocket_client_task(void *pv)
}
}
esp_websocket_client_dispatch_event(client, WEBSOCKET_EVENT_FINISH, NULL, 0);
esp_transport_close(client->transport);
xEventGroupSetBits(client->status_bits, STOPPED_BIT);
client->state = WEBSOCKET_STATE_UNKNOW;