HttpListenerTimeoutManager.IdleConnection 属性

定义

获取或设置允许空闲连接的时间。Gets or sets the time allowed for an idle connection.

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

属性值

TimeSpan

允许空闲连接的时间。The time allowed for an idle connection.

注解

此属性的默认值为2分钟。The default value for this property is 2 minutes.

仅在将连接上的第一个请求路由到之后,才会强制执行此超时 HttpListenerThis 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.

适用于