connect method
Connect to the underlying transport.
Implementation
@override
Future<void> connect() async {
try {
_socket = await Socket.connect(
options.host,
options.port,
);
_socket?.done.then((_) {
_socket = null;
});
} catch (e, _) {
if (!_isRetrying) {
_logger.warning(
'Failed to connect to TCP server, retrying with exponential backoff...',
);
await _retry();
}
return;
}
}