TcpConnectionPoolSettings.LeaseTimeout 属性

定义

获取或设置在多长时间之后连接池中的连接将关闭。

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 连接。

例外

该值不能小于零。

注解

此属性绑定套接字的总生存期。 当套接字存在时间大于 LeaseTimeout 时,它将在返回到连接池时即刻被关闭。 TCP 传输使用的连接缓存将根据需要为每一个终结点创建新连接,直至达到 MaxOutboundConnectionsPerEndpoint 所设置的缓存限制。

适用于