connect method

  1. @override
void connect(
  1. Uri address,
  2. VoidCallback connectCallback,
  3. StringCallback errorHandler, {
  4. int timeoutSeconds = 15,
  5. bool ignoreBadCert = false,
})
override

Connects to address over SSH tunnel provided by client.

Implementation

@override
void connect(
    Uri address, VoidCallback connectCallback, StringCallback errorHandler,
    {int timeoutSeconds = 15, bool ignoreBadCert = false}) {
  tunnelToHost = address.host;
  tunnelToPort = address.port;
  connectHandler = connectCallback;
  connectError = errorHandler;
  if (clientOwner) {
    client.socket.connect(client.hostport, client.onConnected, (error) {
      client.disconnect('connect error');
      if (connectError != null) connectError(error);
    });
  } else {
    if (client.sessionChannel == null) {
      client.success.add(openTunnel);
    } else {
      openTunnel();
    }
  }
}