onHeartbeat method

void onHeartbeat(
  1. dynamic timeout
)

Resets ping timeout.

@api private

Implementation

void onHeartbeat(timeout) {
  if (pingTimeoutTimer != null) {
    pingTimeoutTimer!.cancel();
  }
  pingTimeoutTimer = Timer(
      Duration(milliseconds: timeout ?? (pingInterval! + pingTimeout!)), () {
    if ('closed' == readyState) return;
    onClose('ping timeout');
  });
}