SSHClient constructor

SSHClient({
  1. Uri hostport,
  2. String login,
  3. String termvar = '',
  4. int termWidth = 80,
  5. int termHeight = 25,
  6. String startupCommand,
  7. bool compress = false,
  8. bool agentForwarding = false,
  9. bool closeOnDisconnect,
  10. bool startShell = true,
  11. List<Forward> forwardLocal,
  12. List<Forward> forwardRemote,
  13. VoidCallback disconnected,
  14. ResponseCallback response,
  15. StringCallback print,
  16. StringCallback debugPrint,
  17. StringCallback tracePrint,
  18. VoidCallback success,
  19. FingerprintCallback acceptHostFingerprint,
  20. IdentityFunction loadIdentity,
  21. Uint8ListFunction getPassword,
  22. SocketInterface socketInput,
  23. Random random,
  24. SecureRandom secureRandom,
})

Implementation

SSHClient(
    {Uri hostport,
    this.login,
    this.termvar = '',
    this.termWidth = 80,
    this.termHeight = 25,
    this.startupCommand,
    bool compress = false,
    this.agentForwarding = false,
    this.closeOnDisconnect,
    this.startShell = true,
    List<Forward> forwardLocal,
    List<Forward> forwardRemote,
    VoidCallback disconnected,
    ResponseCallback response,
    StringCallback print,
    StringCallback debugPrint,
    StringCallback tracePrint,
    VoidCallback success,
    this.acceptHostFingerprint,
    this.loadIdentity,
    this.getPassword,
    SocketInterface socketInput,
    Random random,
    SecureRandom secureRandom})
    : super(false,
          hostport: hostport,
          compress: compress,
          forwardLocal: forwardLocal,
          forwardRemote: forwardRemote,
          disconnected: disconnected,
          response: response,
          print: print,
          debugPrint: debugPrint,
          tracePrint: tracePrint,
          socket: socketInput,
          random: random,
          secureRandom: secureRandom) {
  if (success != null) {
    this.success.add(success);
  }
  if (socket == null) {
    if (debugPrint != null) {
      debugPrint('Connecting to $hostport');
    }
    socket = (hostport.hasScheme &&
            (hostport.scheme == 'ws' || hostport.scheme == 'wss'))
        ? WebSocketImpl()
        : SocketImpl();

    socket.connect(
        hostport, onConnected, (error) => disconnect('connect error'));
  }
}