1
0
mirror of https://github.com/s00500/ESPUI.git synced 2024-06-22 23:14:14 +00:00

Trigger a websocket client cleanup on new connection to disconnect old clients and releasing the memory

This commit is contained in:
ChrSchu 2024-06-02 23:21:38 +02:00
parent 75bbece7b5
commit 82460d4aed
No known key found for this signature in database
GPG Key ID: B15D150A1D4D3934

View File

@ -449,6 +449,11 @@ void ESPUIClass::onWsEvent(
}
else
{
if(type == WS_EVT_CONNECT)
{
ws->cleanupClients();
}
if (MapOfClients.end() == MapOfClients.find(client->id()))
{
// Serial.println("ESPUIClass::OnWsEvent:Create new client.");