File tree Expand file tree Collapse file tree 2 files changed +5
-11
lines changed
jooby-jetty/src/main/java/io/jooby/jetty
jooby-undertow/src/main/java/io/jooby/internal/undertow Expand file tree Collapse file tree 2 files changed +5
-11
lines changed Original file line number Diff line number Diff line change 2626import org .eclipse .jetty .util .thread .Invocable ;
2727import org .eclipse .jetty .util .thread .QueuedThreadPool ;
2828import org .eclipse .jetty .util .thread .ThreadPool ;
29- import org .eclipse .jetty .websocket .server .WebSocketUpgradeHandler ;
29+ import org .eclipse .jetty .websocket .server .ServerWebSocketContainer ;
3030
3131import com .typesafe .config .Config ;
3232import edu .umd .cs .findbugs .annotations .NonNull ;
@@ -248,13 +248,9 @@ public io.jooby.Server start(@NonNull Jooby... application) {
248248 ? conf .getDuration ("websocket.idleTimeout" , TimeUnit .MILLISECONDS )
249249 : TimeUnit .MINUTES .toMillis (5 );
250250
251- WebSocketUpgradeHandler .from (
252- server ,
253- context ,
254- container -> {
255- container .setMaxTextMessageSize (maxSize );
256- container .setIdleTimeout (Duration .ofMillis (timeout ));
257- });
251+ var container = ServerWebSocketContainer .ensure (server , context );
252+ container .setMaxTextMessageSize (maxSize );
253+ container .setIdleTimeout (Duration .ofMillis (timeout ));
258254 }
259255 server .setHandler (context );
260256 server .start ();
Original file line number Diff line number Diff line change @@ -326,9 +326,7 @@ void fireConnect() {
326326 conf .hasPath ("websocket.idleTimeout" )
327327 ? conf .getDuration ("websocket.idleTimeout" , TimeUnit .MILLISECONDS )
328328 : TimeUnit .MINUTES .toMillis (5 );
329- if (timeout > 0 ) {
330- channel .setIdleTimeout (timeout );
331- }
329+ channel .setIdleTimeout (timeout );
332330 if (onConnectCallback != null ) {
333331 dispatch (webSocketTask (() -> onConnectCallback .onConnect (this ), true ));
334332 } else {
You can’t perform that action at this time.
0 commit comments