Table of Contents

Method ConnectAsync

Namespace
SshSharp.Extensions.DependencyInjection
Assembly
SshSharp.Extensions.DependencyInjection.dll

ConnectAsync(string, CancellationToken)

Connects to the endpoint registered as name. The caller owns the client and disposes it.

Task<SshClient> ConnectAsync(string name, CancellationToken cancellationToken = default)

Parameters

name string
cancellationToken CancellationToken

Returns

Task<SshClient>

Exceptions

InvalidOperationException

No endpoint is registered as name.

OptionsValidationException

The endpoint's settings are invalid.

SshException

The connection or authentication failed.

TimeoutException

The attempt took longer than ConnectTimeout.