Table of Contents

Method FromEnvironmentAsync

Namespace
SshSharp
Assembly
SshSharp.dll

FromEnvironmentAsync(CancellationToken)

The user's agent, as FromEnvironment() finds it, without blocking a thread. On Windows, finding the agent service's pipe or Pageant's means listing the named pipes, which can be slow (each listing is bounded at 2 seconds); here that wait is awaited. Null when there is no agent to try. Nothing is sent to the agent: whether it is running shows on the first request, such as GetKeysAsync(CancellationToken).

public static Task<SshAgent?> FromEnvironmentAsync(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

Stops waiting for the pipe listing.

Returns

Task<SshAgent>