TcpConnectionPoolSettings.LeaseTimeout 属性

定义

获取或设置在多长时间之后连接池中的连接将关闭。Gets or sets the time span after which a connection in the connection pool is closed.

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

属性值

TimeSpan

返回一个 TimeSpan 结构,该结构指示在多长时间之后从连接池中清除缓存的 TCP 连接。Returns a TimeSpan structure that indicates the time span after which a cached TCP connection is purged from the connection pool.

例外

该值不能小于零。The value cannot be less than zero.

注解

此属性绑定套接字的总生存期。This property bounds the overall lifetime of a socket. 当套接字存在时间大于 LeaseTimeout 时,它将在返回到连接池时即刻被关闭。Once a socket has been around longer than LeaseTimeout, it is closed as soon as it is returned to the connection pool. TCP 传输使用的连接缓存将根据需要为每一个终结点创建新连接,直至达到 MaxOutboundConnectionsPerEndpoint 所设置的缓存限制。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.

适用于