reset method

void reset({
  1. bool started = false,
  2. Map<String, int>? peerPortIndex,
  3. int? fallbackPeerPort,
})

Implementation

void reset({
  bool started = false,
  Map<String, int>? peerPortIndex,
  int? fallbackPeerPort,
}) {
  _started = started;
  _running = false;
  _upError = null;
  _peerPortIndex
    ..clear()
    ..addAll(peerPortIndex ?? const {});
  _fallbackPeerPort = fallbackPeerPort;
  _http?.close();
  _http = null;
  _emitPeers();
}