Skip to content

Commit

Permalink
added example for heartbeat
Browse files Browse the repository at this point in the history
  • Loading branch information
sovcik committed Oct 24, 2018
1 parent 68800e2 commit 9b6ce75
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions examples/esp8266/WebSocketClient/WebSocketClient.ino
Expand Up @@ -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);

}

Expand Down

0 comments on commit 9b6ce75

Please sign in to comment.