How to catch LWIP TCP/IP Events
Posted: Fri Mar 27, 2020 1:15 pm
I use the official sample LWIP / TCP / TLS example:
https://github.com/espressif/esp-idf/tr ... tcp_client
https://github.com/espressif/esp-idf/tr ... ps_mbedtls
All work fine, so we need catch WiFi events -> ESP_ERROR_CHECK(esp_event_handler_register(WIFI_EVENT, ESP_EVENT_ANY_ID, &MyEventFunctionCallback, NULL));
If WiFi Connected/Disconnect -> if (event_base == WIFI_EVENT && event_id == WIFI_EVENT_STA_DISCONNECTED)...
What about Socket Connect/Disconnect events ?
If we create a persistent socket (long during connection), we get no event if the server close the socket for example!.
Please, How to catch Socket Connect/Disconnect events ?
Thank you,
https://github.com/espressif/esp-idf/tr ... tcp_client
https://github.com/espressif/esp-idf/tr ... ps_mbedtls
All work fine, so we need catch WiFi events -> ESP_ERROR_CHECK(esp_event_handler_register(WIFI_EVENT, ESP_EVENT_ANY_ID, &MyEventFunctionCallback, NULL));
If WiFi Connected/Disconnect -> if (event_base == WIFI_EVENT && event_id == WIFI_EVENT_STA_DISCONNECTED)...
What about Socket Connect/Disconnect events ?
If we create a persistent socket (long during connection), we get no event if the server close the socket for example!.
Please, How to catch Socket Connect/Disconnect events ?
Thank you,