We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 68800e2 commit 9b6ce75Copy full SHA for 9b6ce75
examples/esp8266/WebSocketClient/WebSocketClient.ino
@@ -84,6 +84,12 @@ void setup() {
84
85
// try ever 5000 again if connection has failed
86
webSocket.setReconnectInterval(5000);
87
+
88
+ // start heartbeat (optional)
89
+ // ping server every 15000 ms
90
+ // expect pong from server within 3000 ms
91
+ // consider connection disconnected if pong is not received 2 times
92
+ webSocket.enableHeartbeat(15000, 3000, 2);
93
94
}
95
0 commit comments