added example for heartbeat

This commit is contained in:
Jozef Sovcik
2018-10-24 08:17:37 +02:00
parent 68800e2e7a
commit 9b6ce7563a

View File

@ -84,6 +84,12 @@ void setup() {
// try ever 5000 again if connection has failed
webSocket.setReconnectInterval(5000);
// start heartbeat (optional)
// ping server every 15000 ms
// expect pong from server within 3000 ms
// consider connection disconnected if pong is not received 2 times
webSocket.enableHeartbeat(15000, 3000, 2);
}