SocketsHttpHandler.KeepAlivePingTimeout Property

Definition

Gets or sets the keep alive ping timeout.

C#
public TimeSpan KeepAlivePingTimeout { get; set; }

Property Value

The keep alive ping timeout. Defaults to 20 seconds.

Exceptions

The provided value is smaller than 1 second and is not InfiniteTimeSpan

-or-

The provided value is greater than MaxValue milliseconds.

An operation has already been started on the current instance.

The current instance has been disposed.

Remarks

Keep alive pings are sent when a period of inactivity exceeds the configured KeepAlivePingDelay value. The client will close the connection if it doesn't receive any frames within the timeout.

Timeout must be greater than or equal to 1 second. Set to InfiniteTimeSpan to disable the keep alive ping timeout.

Applies to

Product Versions
.NET 5, 6, 7, 8, 9, 10