connectPersistent static method
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);
}