Websocket Inactive sessions detection
QUESTION Is it implemented method/mechanism in this library which to detect and clean the dead/inactive websocket sessions when Websocket client is no longer connected?
SCENARIO / STEPS to Reproduce
-
Web client has established websocket connection with the ESP32 Web server.
-
The client device (PC, mobile, etc.) is connected via WiFi to the Access Point created by the ESP32 device.
-
After some time due to any reason > the WiFi connection of client device (from point 2 above) is dropped/cancelled. The user had NOT closed the web browser tab (upfront the WiFi connection is drop)
and thus is not sent message to the ESP32 Web server that websocket client had left.
ISSUE The case from point 3 above might lead to the situation when
activeClients array > to be completely occupied with handler objects when MAX_CLIENTS number is reached.
Thus activeClients array will be full with handlers of dead websocket sessions and new users will no longer be possible to establish new websocket session.
REFERENCE The variables - activeClients array and MAX_CLIENTS are from "Websocket-Chat" https://github.com/fhessel/esp32_https_server/blob/master/examples/Websocket-Chat/Websocket-Chat.ino
// Includes for the server #include <ESPWebServerSecure.hpp> #include <WebsocketHandler.hpp> #include <HTTPURLEncodedBodyParser.hpp>
===================================== Board: ESP32 Dev Module WEMOS LOLIN32 Core Installation version: IDE name: Arduino IDE Flash Frequency: 240Mhz PSRAM enabled: Upload Speed: 9600 Computer OS: Windows 10