stop method

Future<void> stop()

Stop the server.

Implementation

Future<void> stop() async {
  // Close all client connections.
  for (final socket in _clients.values) {
    await socket.close();
  }
  _clients.clear();
  _sessions.clear();

  await _server?.close();
  _server = null;
}