If the WebSocket client moves to another location and disappears from the network while ESP32 is operating as a server, it does not operate for 20 seconds.
I am using esp32.
This symptom appears when the smartphone is moved to another location while connected to the esp32 server.
Please let me detect that the socket connection has disappeared abnormally.
Or any ideas to reduce the 20 seconds of stopping to work?
Thank.
My code:
void loop() {
server.handleClient();
webSocket.loop();
if (webSocket.connectedClients() > 0) {
String s = String(millis());
webSocket.broadcastTXT(s);
webSocket.broadcastTXT("\n");
delay(1000);
}
}
If the WebSocket client moves to another location and disappears from the network while ESP32 is operating as a server, it does not operate for 20 seconds.
I am using esp32. This symptom appears when the smartphone is moved to another location while connected to the esp32 server. Please let me detect that the socket connection has disappeared abnormally. Or any ideas to reduce the 20 seconds of stopping to work? Thank.
My code: void loop() { server.handleClient(); webSocket.loop(); if (webSocket.connectedClients() > 0) { String s = String(millis()); webSocket.broadcastTXT(s); webSocket.broadcastTXT("\n"); delay(1000); } }