SocketsHttpHandler.PooledConnectionLifetime Property

Definition

Gets or sets how long a connection can be in the pool to be considered reusable.

public:
 property TimeSpan PooledConnectionLifetime { TimeSpan get(); void set(TimeSpan value); };
public TimeSpan PooledConnectionLifetime { get; set; }
member this.PooledConnectionLifetime : TimeSpan with get, set
Public Property PooledConnectionLifetime As TimeSpan

Property Value

TimeSpan

The maximum time for a connection to be in the pool. The default value for this property is InfiniteTimeSpan.

Exceptions

The value specified is less than Zero or is equal to InfiniteTimeSpan.

Remarks

This property defines maximal connection lifetime in the pool regardless of whether the connection is idle or active. The connection is reestablished periodically to reflect the DNS or other network changes.

If the connection endpoint is not the Domain name but the IP address, the value can be InfiniteTimeSpan.

Applies to