I need to inform you about a little details that I care about.
The connection between WebSocket Server and a WS client shutdown itself if there is no websocket events for a duration greater thant the idleTimeoutMillis value
Normally Websocket shoudln't have such timeout policy, my guess is it's an implementation issues with Jetty (but it's not the discussion here)
The underlying Jetty Websocket implementation use long primitive for this value see WebSocketPolicy#setIdleTimeout(long ms).
But SparkJava API provide integer in the method Spark#webSocketIdleTimeoutMillis(int timeoutMillis)
For information the mapping between SparkJava API and Websocket API is done in this class: WebSocketServletContextHandlerFactory
So we have less control over this value, and on some use case it can be useful to declare Idle Timeout to a big number:
the Max Value Integer correspond to 28 days in milliseconds
If it was a long it would be (equal to infinity: 292471208 years)
Small impacts (IMO), but this feature is probably not the most wanted :)
Hello all,
I need to inform you about a little details that I care about.
The connection between WebSocket Server and a WS client shutdown itself if there is no websocket events for a duration greater thant the idleTimeoutMillis value
Normally Websocket shoudln't have such timeout policy, my guess is it's an implementation issues with Jetty (but it's not the discussion here)
The underlying Jetty Websocket implementation use long primitive for this value see
WebSocketPolicy#setIdleTimeout(long ms)
. But SparkJava API provide integer in the methodSpark#webSocketIdleTimeoutMillis(int timeoutMillis)
For information the mapping between SparkJava API and Websocket API is done in this class:
WebSocketServletContextHandlerFactory
So we have less control over this value, and on some use case it can be useful to declare Idle Timeout to a big number:
Small impacts (IMO), but this feature is probably not the most wanted :)
That's all.