Add ping interval to constructor params for WebSocketServer (#497)
* Update .gitignore for CLion compatibility * Add pingIntervalSeconds to constructor for WebSocketServer * Add Heartbeat section to WebSocketServer usage documentation * Fix typo
This commit is contained in:
@ -445,6 +445,17 @@ server.wait();
|
||||
|
||||
```
|
||||
|
||||
### Heartbeat
|
||||
|
||||
You can configure an optional heartbeat / keep-alive for the WebSocket server. The heartbeat interval can be adjusted or disabled when constructing the `WebSocketServer`. Setting the interval to `-1` disables the heartbeat feature; this is the default setting. The parameter you set will be applied to every `WebSocket` object that the server creates.
|
||||
|
||||
To enable a 45 second heartbeat on a `WebSocketServer`:
|
||||
|
||||
```cpp
|
||||
int pingIntervalSeconds = 45;
|
||||
ix::WebSocketServer server(port, host, backlog, maxConnections, handshakeTimeoutSecs, addressFamily, pingIntervalSeconds);
|
||||
```
|
||||
|
||||
## HTTP client API
|
||||
|
||||
```cpp
|
||||
|
Reference in New Issue
Block a user