diff --git a/jetty-websocket/websocket-client/src/main/java/org/eclipse/jetty/websocket/client/io/ConnectPromise.java b/jetty-websocket/websocket-client/src/main/java/org/eclipse/jetty/websocket/client/io/ConnectPromise.java index 85e13fe0208..f918abf2168 100644 --- a/jetty-websocket/websocket-client/src/main/java/org/eclipse/jetty/websocket/client/io/ConnectPromise.java +++ b/jetty-websocket/websocket-client/src/main/java/org/eclipse/jetty/websocket/client/io/ConnectPromise.java @@ -81,16 +81,16 @@ public abstract class ConnectPromise extends FuturePromise implements R return response; } - public void onOpen(WebSocketSession session) + public void setResponse(ClientUpgradeResponse response) + { + this.response = response; + } + + public void succeeded(WebSocketSession session) { session.setUpgradeRequest(request); session.setUpgradeResponse(response); session.open(); super.succeeded(session); } - - public void setResponse(ClientUpgradeResponse response) - { - this.response = response; - } } \ No newline at end of file diff --git a/jetty-websocket/websocket-client/src/main/java/org/eclipse/jetty/websocket/client/io/WebSocketClientConnection.java b/jetty-websocket/websocket-client/src/main/java/org/eclipse/jetty/websocket/client/io/WebSocketClientConnection.java index 575bf27fe4a..edbca561730 100644 --- a/jetty-websocket/websocket-client/src/main/java/org/eclipse/jetty/websocket/client/io/WebSocketClientConnection.java +++ b/jetty-websocket/websocket-client/src/main/java/org/eclipse/jetty/websocket/client/io/WebSocketClientConnection.java @@ -80,7 +80,7 @@ public class WebSocketClientConnection extends AbstractWebSocketConnection WebSocketSession session = getSession(); ConnectionManager connectionManager = connectPromise.getClient().getConnectionManager(); connectionManager.addSession(session); - connectPromise.onOpen(session); + connectPromise.succeeded(session); connected = true; } super.onOpen();