connect static method

Future<BufferedSocket> connect(
  1. String? host,
  2. int? port, {
  3. DataReadyHandler? onDataReady,
  4. DoneHandler? onDone,
  5. ErrorHandler? onError,
  6. ClosedHandler? onClosed,
  7. SocketFactory socketFactory = defaultSocketFactory,
})

Implementation

static Future<BufferedSocket> connect(
  String? host,
  int? port, {
  DataReadyHandler? onDataReady,
  DoneHandler? onDone,
  ErrorHandler? onError,
  ClosedHandler? onClosed,
  SocketFactory socketFactory = defaultSocketFactory,
}) async {
  var socket;
  socket = await socketFactory(host, port);
  socket.setOption(SocketOption.tcpNoDelay, true);
  return BufferedSocket._(socket, onDataReady, onDone, onError, onClosed);
}