setPingTimeout method

void setPingTimeout()

Sets and resets ping timeout timer based on client pings.

Implementation

void setPingTimeout() {
  if (pingTimeoutTimer != null) {
    pingTimeoutTimer!.cancel();
  }
  pingTimeoutTimer = Timer(
      Duration(milliseconds: server.pingInterval + server.pingTimeout), () {
    onClose('ping timeout');
  });
}