3

我正在处理现有的 Jetty Application ,它在 Application 中配置了 maxIdleTime 。

<servlet>
      <servlet-name>UserServlet</servlet-name>
      <servlet-class>com.UserServlet</servlet-class>
      <init-param>
         <param-name>maxIdleTime</param-name>
           <param-value>300000</param-value>
      </init-param>
     </servlet>

根据 Jetty 文档,这意味着但我不明白这是什么意思?谁能告诉我。提前致谢 。

Set the maximum Idle time for a connection, which roughly translates to the Socket.setSoTimeout(int) call, although with NIO implementations other mechanisms may be used to implement the timeout. The max idle time is applied: when waiting for a new request to be received on a connection; when reading the headers and content of a request; when writing the headers and content of a response. Jetty interprets this value as the maximum time between some progress being made on the connection. So if a single byte is read or written, then the timeout (if implemented by jetty) is reset. However, in many instances, the reading/writing is delegated to the JVM, and the semantic is more strictly enforced as the maximum time a single read/write operation can take. Note, that as Jetty supports writes of memory mapped file buffers, then a write may take many 10s of seconds for large content written to a slow device.
4

1 回答 1

4

在您上面提到的上下文中,作为用户 servlet 的初始化参数,它与 Jetty 无关。它只是一个传递给该 servlet 的参数,完全取决于该 servlet 将如何处理它。

在码头内,您是否为连接器设置了诸如最大空闲时间之类的东西,那么在连接器因空闲超时而关闭之前,该连接器将被允许在没有流量的情况下保持空闲多长时间。

于 2012-09-14T11:20:51.480 回答