Table of Contents

Method PingAsync

Namespace
SshSharp
Assembly
SshSharp.dll

PingAsync(CancellationToken)

Measures the round trip to the server and proves the connection is alive. OpenSSH 9.5 and later answer a transport ping (ping@openssh.com); other servers get a keepalive@openssh.com request, whose answer arrives just as quickly.

public Task<TimeSpan> PingAsync(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

Returns

Task<TimeSpan>

Exceptions

SshException

The connection is closed or failed meanwhile.