arduinoWebSockets icon indicating copy to clipboard operation
arduinoWebSockets copied to clipboard

Hanging websocket server when communication with the client is lost.

Open workpage2 opened this issue 2 years ago • 1 comments

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?

workpage2 avatar Feb 22 '23 21:02 workpage2

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(); }

workpage2 avatar Feb 23 '23 07:02 workpage2