Property Client
- Namespace
- SshSharp.Extensions.DependencyInjection
- Assembly
- SshSharp.Extensions.DependencyInjection.dll
Client
The client concerned: the new connection for Connected and Reconnected (owned by the provider: do not dispose it), the one that ended for Disconnected (no longer usable).
public SshClient Client { get; }
Property Value
Remarks
Events are delivered after the fact, so by the time one is handled the client may have ended and already been disposed: the provider disposes an ended connection when the next GetClientAsync(string, CancellationToken) replaces it. Using it can then throw ObjectDisposedException as well as SshException; check IsConnected when either is caught, and wait for the next event.