set pingInterval()

in lib/src/copy/web_socket_impl.dart [781:796]


  set pingInterval(Duration? interval) {
    if (_writeClosed) return;
    if (_pingTimer != null) _pingTimer!.cancel();
    _pingInterval = interval;

    if (_pingInterval == null) return;

    _pingTimer = Timer(_pingInterval!, () {
      if (_writeClosed) return;
      _consumer.add(_WebSocketPing());
      _pingTimer = Timer(_pingInterval!, () {
        // No pong received.
        _close(WebSocketStatus.GOING_AWAY);
      });
    });
  }