Interface ISshConnectionProvider
- Namespace
- SshSharp.Extensions.DependencyInjection
- Assembly
- SshSharp.Extensions.DependencyInjection.dll
One long-lived connection per endpoint registered with services.AddSshClient(name), shared by its callers and opened again
when it drops. The provider owns the clients and disposes them with the container: callers must not dispose them.
public interface ISshConnectionProvider
Methods
- GetClientAsync(string, CancellationToken)
The connected client for
name: the shared one if it is still up, otherwise a new connection, which then becomes the shared one. Concurrent callers share one attempt. After a failed attempt the next one waits (from ReconnectDelay, doubling, up to MaxReconnectDelay); a call made during that wait fails at once, with an SshException whose inner exception is the last failure, rather than connecting again.