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 ;
@@ -236,13 +236,9 @@ public io.jooby.Server start(@NonNull Jooby... application) {
236236 ? conf .getDuration ("websocket.idleTimeout" , TimeUnit .MILLISECONDS )
237237 : TimeUnit .MINUTES .toMillis (5 );
238238
239- WebSocketUpgradeHandler .from (
240- server ,
241- context ,
242- container -> {
243- container .setMaxTextMessageSize (maxSize );
244- container .setIdleTimeout (Duration .ofMillis (timeout ));
245- });
239+ var container = ServerWebSocketContainer .ensure (server , context );
240+ container .setMaxTextMessageSize (maxSize );
241+ container .setIdleTimeout (Duration .ofMillis (timeout ));
246242 }
247243 server .setHandler (context );
248244 server .start ();
Original file line number Diff line number Diff line change @@ -325,9 +325,7 @@ void fireConnect() {
325325 conf .hasPath ("websocket.idleTimeout" )
326326 ? conf .getDuration ("websocket.idleTimeout" , TimeUnit .MILLISECONDS )
327327 : TimeUnit .MINUTES .toMillis (5 );
328- if (timeout > 0 ) {
329- channel .setIdleTimeout (timeout );
330- }
328+ channel .setIdleTimeout (timeout );
331329 if (onConnectCallback != null ) {
332330 dispatch (webSocketTask (() -> onConnectCallback .onConnect (this ), true ));
333331 } else {
You can’t perform that action at this time.
0 commit comments