fmatz
fmatz

Reputation: 29

Jetty WebSocket TimeOutException: Idle timeout expired?

I am on Jetty Websocket (jetty-all-9.4.5.v20170502-uber.jar) on the server side getting one time out :

**java.util.concurrent.TimeoutException: Idle timeout expired: 300011/300000 ms**
Socket Closed: CloseReason[1001,Idle Timeout]
Socket Closed: CloseReason[1001,Idle Timeout]
    at org.eclipse.jetty.io.IdleTimeout.checkIdleTimeout(IdleTimeout.java:166)
    at org.eclipse.jetty.io.IdleTimeout$1.run(IdleTimeout.java:50)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at java.lang.Thread.run(Thread.java:748)**

This is a unique event at the beginning and everything else works perfectly!

I tried to change this:

_context = new ServletContextHandler(ServletContextHandler.SESSIONS);
_context.setContextPath("/");
System.out.println(_context.getStopTimeout());
_context.setStopTimeout(0);
_server.setHandler(_context);

~ without success !

No idea.

Upvotes: 2

Views: 4670

Answers (1)

Joakim Erdfelt
Joakim Erdfelt

Reputation: 49555

WARNING: Don't use jetty-all for your project, its not meant to be used outside of the Jetty Quickstart Documentation.

Idle Timeout in WebSocket is controlled by the WebSocketPolicy.

The Idle Timeout can be specified on the WebSocket Container (eg: WebSocketClient or WebSocketServletFactory) or even on the individual connected WebSocket Sessions.

Your code example doesn't show anything to do with WebSocket, so I cannot provide you the specific information you need to configure your websocket behavior.

Upvotes: 2

Related Questions