close method

Future<void> close()

Closes all active connections.

Implementation

Future<void> close() async {
  for (final socket in _connections.values) {
    await socket.close();
  }
  _connections.clear();
  await server?.close();
  server = null;
}