Property StaggeredConnectDelay
- Namespace
- SshSharp
- Assembly
- SshSharp.dll
StaggeredConnectDelay
Races the server's addresses instead of trying them one after another, as RFC 8305 ("Happy Eyeballs") describes: when its name has several addresses, the next is tried once the one before has had this long to connect or has failed, whichever comes first, IPv6 and IPv4 addresses taking turns, and the first connection made is used. A server whose first address does not answer (a broken IPv6 route, say) is then reached after this delay, not after the system's connect timeout, which can be minutes. RFC 8305 recommends 250 milliseconds. Null (the default) tries the addresses in order, each until it fails, as ssh does.
public TimeSpan? StaggeredConnectDelay { get; init; }
Property Value
Remarks
It applies where ConfigureSocket does: the TCP connection to the server, or to the first of the JumpHosts. Not the connection to a Proxy, nor a host given as an IP address or a name with one address, which have nothing to race. The name is resolved once, by the system's resolver, whose order (RFC 6724) decides which family goes first.
Several sockets may then be connecting at once. ConfigureSocket is still called once for each, before it connects, one at a time, never on two at once; the sockets that lose the race are closed. A server may log the connections that lost as connections closed before the handshake. Each retry that ConnectionAttempts makes races the addresses again.
Exceptions
- ArgumentOutOfRangeException
The value is less than 10 milliseconds or more than 2 seconds, the bounds RFC 8305 sets.