Condividi tramite


TcpConnectionPoolSettings.LeaseTimeout Property

Microsoft Silverlight will reach end of support after October 2021. Learn more.

Gets or sets the time span after which a connection in the connection pool is closed.

Namespace:  System.ServiceModel.Channels
Assembly:  System.ServiceModel.NetTcp (in System.ServiceModel.NetTcp.dll)

Syntax

'Declaration
Public Property LeaseTimeout As TimeSpan
public TimeSpan LeaseTimeout { get; set; }

Property Value

Type: System.TimeSpan
A TimeSpan structure that indicates the time span after which a cached TCP connection is purged from the connection pool.

Exceptions

Exception Condition
ArgumentOutOfRangeException

The value is less than zero.

Remarks

This property bounds the overall lifetime of a socket. When a socket has been around longer than LeaseTimeout, it is closed as soon as it is returned to the connection pool. The connection cache used by the TCP transport creates new connections as required for each endpoint up to the cache limit that is set by MaxOutboundConnectionsPerEndpoint.

Version Information

Silverlight

Supported in: 5, 4

Platforms

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.