Table of Contents

Property ConnectTimeout

Namespace
SshSharp
Assembly
SshSharp.dll

ConnectTimeout

How long the connection attempt may take, as ssh_config's ConnectTimeout: resolving the name and the TCP connection (or the connection through Proxy), the SSH handshake, host key verification and authentication, the time spent in your callbacks included (KeyboardInteractive, a host key prompt). When it passes, the attempt fails with an SshException whose Reason is Timeout (its inner exception is a TimeoutException); a cancelled CancellationToken still ends it with an OperationCanceledException. It ends with the connection: once connected, operations are bounded by their own tokens. Null (the default) or InfiniteTimeSpan sets no limit but the token. Over a stream you opened (ConnectAsync(Stream, SshClientOptions, bool, CancellationToken)) it bounds the handshake and authentication.

public TimeSpan? ConnectTimeout { get; init; }

Property Value

TimeSpan?

Exceptions

ArgumentOutOfRangeException

The value is zero or negative (other than infinite), or longer than about 24 days.