Bug 56361 - org.apache.tomcat.websocket.WsWebSocketContainer#backgroundProcess() period should be configurable
Summary: org.apache.tomcat.websocket.WsWebSocketContainer#backgroundProcess() period s...
Alias: None
Product: Tomcat 8
Classification: Unclassified
Component: WebSocket (show other bugs)
Version: 8.0.x-trunk
Hardware: PC Linux
: P2 enhancement (vote)
Target Milestone: ----
Assignee: Tomcat Developers Mailing List
Depends on:
Reported: 2014-04-08 05:44 UTC by Eugene Chung (TmaxSoft)
Modified: 2019-08-13 09:04 UTC (History)
0 users


Note You need to log in before you can comment on or make changes to this bug.
Description Eugene Chung (TmaxSoft) 2014-04-08 05:44:38 UTC
Currently, the period of WebSocketContainer's background process is 10 seconds. 
(org.apache.tomcat.websocket.WsWebSocketContainer#processPeriod is set to 10 by code)

This applies to the timeout of WebSocket sessions, which it can be configured by javax.websocket.Session#setMaxIdleTimeout(long milliseconds).

If the developer wants to set the session's timeout less than 10 seconds, for example 5 seconds, it usually doesn't be expired 5 seconds later.

So I think org.apache.tomcat.websocket.WsWebSocketContainer#processPeriod should be configurable.
Comment 1 Mark Thomas 2019-08-13 09:04:08 UTC
It is configurable. Cast the WebSocketContainer to org.apache.tomcat.websocket.WsWebSocketContainer and then call setProcessPeriod(int)

It is configured this way for the unit tests.