arduinoWebSockets
arduinoWebSockets copied to clipboard
Hanging websocket server when communication with the client is lost.
If the esp32 websocket server suddenly loses contact with the client while communicating, the websocket is frozen. A program stop can take an hour or more. If the connection is restored, the work is restored. Is there a solution to this problem?
I made a temporary solution to the problem, but it is desirable to do this at the library level:
if (program_start==0)
{
timer_ws=millis();
program_start=1;
}
if ((timer_ws+15000)<millis())
{
Serial.println("\nreboot websocket");
timer_ws=millis();
webSocket.close();
webSocket.begin();
}