stop method

void stop()

Stops the watchdog and closes every peer connection so nodes and clients observe the shutdown (and nodes begin reconnecting).

Implementation

void stop() {
  _monitor.stop();
  for (final reg in tunnels.all.toList()) {
    _destroyTunnel(reg, notifyExposer: false);
  }
  for (final peer in _peers.values.toList()) {
    unawaited(peer.connection.close(4503, 'hub stopping'));
  }
  _peers.clear();
  aiProxy?.close();
}