Skip to content

Commit

Permalink
add small documentation paragraph on Heartbeat messages for the WebSo…
Browse files Browse the repository at this point in the history
…cket binding

Signed-off-by: Florian Fendt <Florian.Fendt@bosch-si.com>
  • Loading branch information
ffendt committed Jan 15, 2018
1 parent e5806cf commit d486c63
Showing 1 changed file with 17 additions and 0 deletions.
Expand Up @@ -225,3 +225,20 @@ This message is acknowledged by Ditto by sending back:
```
STOP-SEND-LIVE-EVENTS:ACK
```

### Heartbeat messages

In order to keep the WebSocket connection alive, you need to send data on a
regular basis. Since there might be times where no data is available before
the connection would time out, we advise you to send Ping messages **every
60 seconds**.


Ditto detects any empty binary message as a Heartbeat message and will keep
the connection alive. If your framework does not support sending Ping messages,
you can implement them on your own. E.g. when working with JavaScript, you
could do this by sending an empty Buffer:

```javascript
websocket.send(new ArrayBuffer(0))
```

0 comments on commit d486c63

Please sign in to comment.