connectPersistent static method

Future<TcpClient> connectPersistent(
  1. String host,
  2. int port, {
  3. String? terminatorString,
  4. List<int>? terminatorBytes,
  5. Duration timeout = const Duration(seconds: 2),
})

creates an auto-reconnecting TcpClient and immediately attempts to connect. after the connection has been initiated, the future will be completed.

Implementation

static Future<TcpClient> connectPersistent(
  String host,
  int port, {
  String? terminatorString,
  List<int>? terminatorBytes,
  Duration timeout = const Duration(seconds: 2),
}) async {
  return connect(host, port,
      terminatorString: terminatorString,
      terminatorBytes: terminatorBytes,
      timeout: timeout,
      connectionType: TcpConnectionType.persistent);
}