SocketsHttpHandler.KeepAlivePingDelay Property

Definition

Important

Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.

Gets or sets the keep alive ping delay.

C#
public TimeSpan KeepAlivePingDelay { get; set; }

Property Value

The keep alive ping delay. Defaults to InfiniteTimeSpan.

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

The client will send a keep alive ping to the server if it doesn't receive any frames on a connection for this period of time. This property is used together with KeepAlivePingTimeout to check whether the connection is broken.

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

Applies to

Produkt Versioner
.NET 5, 6, 7, 8, 9, 10