connect method
Implementation
Future<void> connect(dynamic host, int port, [Duration? timeout]) async {
_socket = await Socket.connect(host, port, timeout: timeout);
_subscription = _socket
?.asyncExpand((bytes) => Stream.fromIterable(bytes))
.listen(
(_) {},
onError: (_) async => await disconnect(),
onDone: () async => await disconnect(),
);
_subscription?.pause();
}