Method GetClientAsync
- Namespace
- SshSharp.Extensions.DependencyInjection
- Assembly
- SshSharp.Extensions.DependencyInjection.dll
GetClientAsync(CancellationToken)
The endpoint's shared connection, as GetClientAsync(string, CancellationToken) returns it: owned by the provider, not to be disposed.
Task<SshClient> GetClientAsync(CancellationToken cancellationToken = default)
Parameters
cancellationTokenCancellationToken
Returns
Exceptions
- OptionsValidationException
The endpoint's settings are invalid.
- SshException
The connection or authentication failed, now or (as its inner exception) in the last attempt.
- TimeoutException
The attempt took longer than ConnectTimeout.