startKeepAlive method

  1. @override
void startKeepAlive(
  1. Duration interval, {
  2. Duration timeout = const Duration(seconds: 10),
  3. int maxMissed = 1,
})
override

Ping the server every interval (basic/utilities/ping: implementations should check connection health periodically, at a configurable rate). A ping not answered within timeout is missed; maxMissed misses in a row are a connection failure: it is logged and the client disconnects with DisconnectReason.pingTimeout. An answered ping resets the count. Off unless started; revisions without ping (2026-07-28) refuse it.

Implementation

@override
void startKeepAlive(
  Duration interval, {
  Duration timeout = const Duration(seconds: 10),
  int maxMissed = 1,
}) => inner.startKeepAlive(interval, timeout: timeout, maxMissed: maxMissed);