diff --git a/jetty-websocket/websocket-client/src/main/java/org/eclipse/jetty/websocket/client/WebSocketClient.java b/jetty-websocket/websocket-client/src/main/java/org/eclipse/jetty/websocket/client/WebSocketClient.java index 67c0f29bd95..b69627e185f 100644 --- a/jetty-websocket/websocket-client/src/main/java/org/eclipse/jetty/websocket/client/WebSocketClient.java +++ b/jetty-websocket/websocket-client/src/main/java/org/eclipse/jetty/websocket/client/WebSocketClient.java @@ -84,17 +84,17 @@ public class WebSocketClient extends ContainerLifeCycle public WebSocketClient(Executor executor) { - this(executor,null); + this(null,executor); } - + public WebSocketClient(SslContextFactory sslContextFactory) { - this(null,sslContextFactory); + this(sslContextFactory,null); } - - public WebSocketClient(Executor executor, SslContextFactory sslContextFactory) + + public WebSocketClient(SslContextFactory sslContextFactory, Executor executor) { - this.executor=executor; + this.executor = executor; this.sslContextFactory = sslContextFactory; this.policy = WebSocketPolicy.newClientPolicy(); this.bufferPool = new MappedByteBufferPool(); @@ -104,7 +104,6 @@ public class WebSocketClient extends ContainerLifeCycle this.sessionFactory = new WebSocketSessionFactory(); } - public Future connect(Object websocket, URI toUri) throws IOException { ClientUpgradeRequest request = new ClientUpgradeRequest(toUri); @@ -208,8 +207,10 @@ public class WebSocketClient extends ContainerLifeCycle addBean(executor,true); } else + { addBean(executor,false); - + } + if (connectionManager != null) { return;