Method ConnectAsync
- Namespace
- SshSharp.Extensions.DependencyInjection
- Assembly
- SshSharp.Extensions.DependencyInjection.dll
ConnectAsync(CancellationToken)
A new connection to the endpoint, as ConnectAsync(string, CancellationToken) opens it: the caller owns it and disposes it.
Task<SshClient> ConnectAsync(CancellationToken cancellationToken = default)
Parameters
cancellationTokenCancellationToken
Returns
Exceptions
- OptionsValidationException
The endpoint's settings are invalid.
- SshException
The connection or authentication failed.
- TimeoutException
The attempt took longer than ConnectTimeout.