SSHClient constructor
SSHClient({
- Uri hostport,
- String login,
- String termvar = '',
- int termWidth = 80,
- int termHeight = 25,
- String startupCommand,
- bool compress = false,
- bool agentForwarding = false,
- bool closeOnDisconnect,
- bool startShell = true,
- List<
Forward> forwardLocal, - List<
Forward> forwardRemote, - VoidCallback disconnected,
- ResponseCallback response,
- StringCallback print,
- StringCallback debugPrint,
- StringCallback tracePrint,
- VoidCallback success,
- FingerprintCallback acceptHostFingerprint,
- IdentityFunction loadIdentity,
- Uint8ListFunction getPassword,
- SocketInterface socketInput,
- Random random,
- 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'));
}
}