SocketsHttpHandler.PooledConnectionLifetime Property


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

 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


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


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


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