bind static method

Future<SocketTerminalHostServer> bind({
  1. InternetAddress? address,
  2. int port = 2323,
  3. bool v6Only = false,
  4. bool shared = false,
  5. required SocketTerminalSessionHandler onSession,
})

Binds a socket host server.

Implementation

static Future<SocketTerminalHostServer> bind({
  io.InternetAddress? address,
  int port = 2323,
  bool v6Only = false,
  bool shared = false,
  required SocketTerminalSessionHandler onSession,
}) async {
  final server = await io.ServerSocket.bind(
    address ?? io.InternetAddress.loopbackIPv4,
    port,
    v6Only: v6Only,
    shared: shared,
  );
  return SocketTerminalHostServer._(server: server, onSession: onSession);
}