connect method

  1. @override
Future<AtTransport> connect(
  1. String host,
  2. String port, {
  3. Duration? timeout,
})
override

Both a refused connection (SocketException) and a failed or rejected handshake (TlsException) surface as SecondaryConnectException; the cause is kept in the message. The caller supplies whose atServer this was.

Implementation

@override
Future<AtTransport> connect(String host, String port,
    {Duration? timeout}) async {
  try {
    return SecureSocketTransport(await SecureSocketUtil.createSecureSocket(
        host, port, secureSocketConfig,
        timeout: timeout));
  } on SocketException catch (e) {
    throw _unreachable(host, port, e);
  } on TlsException catch (e) {
    throw _unreachable(host, port, e);
  }
}