Jetty Maxidletime

孤街浪徒 提交于 2019-12-23 09:48:09

问题


When does maxidletime in jetty get triggered?


回答1:


The maxIdleTime setting is passed to the operating system's Socket handler and becomes the timeout value for that socket. If the other end of the connection keeps the connection alive, the connection will never be closed by the OS. Jetty's Thread will wait for as long as the OS deems the connection to be still 'alive'.




回答2:


The maxIdle time was originally passed to the socket sotimeout. However, now that jetty is asynchronous, it is not strictly used like that because the sotimeout only applies to blocking operations.

Instead the timeout is used in two circumstances:

1) if a connection is idle (no response outstanding), then if that timeout expires the connection will be closed.

2) if an IO operation is being attempted (normally a blocking read or write from a servlet), then the timeout is applied almost as if it were implemented with a blocking socket read and it was an soTimeout - ie if the IO read/write makes no progress for the timeout period, the operation will fail with a TimeoutException.

Note in jetty-9, maxIldeTime has been renamed idleTimeout



来源:https://stackoverflow.com/questions/3094221/jetty-maxidletime

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!