close method

Future<void> close()

Stops the relay and disconnects every client.

Implementation

Future<void> close() async {
  for (final socket in _clients.values.toList()) {
    await socket.close();
  }
  _clients.clear();
  await _server.close(force: true);
}