ESPAsyncWebServer icon indicating copy to clipboard operation
ESPAsyncWebServer copied to clipboard

How do you close We socket client on WIFI disconnection??

Open interstellarelectric opened this issue 3 years ago • 1 comments

If the Client WIFI is disconnected before browser is closed.

Sometimes I get Message "[AsyncTCP.cpp] _poll(): ack timeout 4" and the websocket can close correctly.

However sometime nothing happened and the Heap would fill up and "Error Too many message queued"

What can I do here?

I tried the following code:

void WiFiStationDisconnected(WiFiEvent_t event, WiFiEventInfo_t info) { websocket.closeAll(); Serial.println(websocket.count()); }

websocket.closeAll(); doesnt work; ws.count(); Still shows there are connection websocket.close(); doesnt work; ws.count(); Still shows there are connection server.reset(); Crash ESP32;

interstellarelectric avatar Oct 04 '22 19:10 interstellarelectric

[STALE_SET] This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Jun 18 '23 13:06 stale[bot]