createOutBoundConnection method

Future<bool> createOutBoundConnection(
  1. dynamic host,
  2. dynamic port,
  3. dynamic toAtSign
)

Implementation

Future<bool> createOutBoundConnection(host, port, toAtSign) async {
  try {
    var secureSocket = await SecureSocket.connect(host, int.parse(port));
    _connection = OutboundConnectionImpl(secureSocket);
    if (outboundConnectionTimeout != null) {
      _connection!.setIdleTime(outboundConnectionTimeout);
    }
  } on SocketException {
    throw SecondaryConnectException('unable to connect to secondary');
  }
  return true;
}