Default constructor.
The web socket instance on which we want to perform the checks and start the monitoring.
The interval between which ping/pong messages are exchanged between client and server (defaults to 1 minute).
Callback called on client/server connection end, detected from missing heartbeat updates.
Does some basic checks about the web socket state and starts the actual heartbeat monitoring.
Implements the business logic required for the heartbeat detection to work. If the heartbeat stops respecting the previously-set timeout, the client/server connection is considered dead and the eventually passed in callback is called. The web socket is also closed with code 1008 (policy violation) and message "Heartbeat stopped".
Generated using TypeDoc
Actively handles the heartbeat ping/pong mechanism respecting the specified parameters.