addServerSocket method

Future<void> addServerSocket(
  1. ServerSocket server
)

Add already bound ServerSocket.

Implementation

Future<void> addServerSocket(ServerSocket server) async {
  if (proxies.containsKey(server.port))
    throw const SocketException('ServerSocket already in use.');
  proxies.addAll({server.port: server});
  unawaited(_listenForClientConnections(server));
}