在Jetty 6.1.19上configuration保持活动超时

如何设置连接到Jetty Web服务器的连接超时(在我的情况下是v6.1.19)?

我想configurationJetty在客户端请求保持活动时保持连接打开的时间。 目前这似乎是无限的。

这可以通过在sockets连接器上设置“maxIdleTime”进行configuration。 参见configuration连接器

例如在jetty.xml中

<Call name="addConnector"> <Arg> <New class="org.mortbay.jetty.nio.SelectChannelConnector"> <Set name="maxIdleTime">10000</Set> 

从手册:

设置连接的最大空闲时间,这大致转换为Socket.setSoTimeout(int)调用,但是使用NIO实现,也可以使用其他机制来实现超时。