HttpListenerTimeoutsElement.IdleConnection 属性
定义
获取允许空闲连接的时间(以秒为单位)。Gets the time, in seconds, allowed for an idle connection.
public:
property TimeSpan IdleConnection { TimeSpan get(); };
[System.Configuration.ConfigurationProperty("idleConnection", DefaultValue=Mono.Cecil.CustomAttributeArgument, IsRequired=false)]
public TimeSpan IdleConnection { get; }
[<System.Configuration.ConfigurationProperty("idleConnection", DefaultValue=Mono.Cecil.CustomAttributeArgument, IsRequired=false)>]
member this.IdleConnection : TimeSpan
Public ReadOnly Property IdleConnection As TimeSpan
属性值
允许空闲连接的时间(以秒为单位)。The time, in seconds, allowed for an idle connection.
- 属性
注解
仅在将连接上的第一个请求路由到之后,才会强制执行此超时 HttpListener 。This timeout is only enforced after the first request on the connection is routed to the HttpListener.
在分析标头之前,系统无法确定与请求关联的请求队列或 URL 组。The system cannot determine the request queue or URL group that the request is associated with until the headers have been parsed. 因此,会 HttpListener IdleConnection 为连接上的第一个请求强制默认计时器。Therefore, the HttpListener enforces the default IdleConnection timer for the first request on a connection. 对 keep-alive 连接的后续请求将使用此属性上设置的值。Subsequent requests on a Keep-Alive connection will use the value set on this property.