diff --git a/jetty-websocket/websocket-client/src/main/java/org/eclipse/jetty/websocket/client/io/WebSocketClientAsyncConnection.java b/jetty-websocket/websocket-client/src/main/java/org/eclipse/jetty/websocket/client/io/WebSocketClientAsyncConnection.java new file mode 100644 index 00000000000..58ebadbc4f3 --- /dev/null +++ b/jetty-websocket/websocket-client/src/main/java/org/eclipse/jetty/websocket/client/io/WebSocketClientAsyncConnection.java @@ -0,0 +1,22 @@ +package org.eclipse.jetty.websocket.client.io; + +import java.util.concurrent.Executor; +import java.util.concurrent.ScheduledExecutorService; + +import org.eclipse.jetty.io.AsyncEndPoint; +import org.eclipse.jetty.io.ByteBufferPool; +import org.eclipse.jetty.websocket.api.WebSocketPolicy; +import org.eclipse.jetty.websocket.client.WebSocketClientFactory; +import org.eclipse.jetty.websocket.io.WebSocketAsyncConnection; + +public class WebSocketClientAsyncConnection extends WebSocketAsyncConnection +{ + private final WebSocketClientFactory factory; + + public WebSocketClientAsyncConnection(AsyncEndPoint endp, Executor executor, ScheduledExecutorService scheduler, WebSocketPolicy policy, + ByteBufferPool bufferPool, WebSocketClientFactory factory) + { + super(endp,executor,scheduler,policy,bufferPool); + this.factory = factory; + } +} diff --git a/jetty-websocket/websocket-client/src/main/java/org/eclipse/jetty/websocket/client/io/WebSocketClientSelectorManager.java b/jetty-websocket/websocket-client/src/main/java/org/eclipse/jetty/websocket/client/io/WebSocketClientSelectorManager.java index fedfba91c74..79075100628 100644 --- a/jetty-websocket/websocket-client/src/main/java/org/eclipse/jetty/websocket/client/io/WebSocketClientSelectorManager.java +++ b/jetty-websocket/websocket-client/src/main/java/org/eclipse/jetty/websocket/client/io/WebSocketClientSelectorManager.java @@ -21,6 +21,7 @@ import java.nio.channels.SocketChannel; import java.util.concurrent.Executor; import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.atomic.AtomicReference; + import javax.net.ssl.SSLEngine; import javax.net.ssl.SSLException; @@ -76,7 +77,7 @@ public class WebSocketClientSelectorManager extends SelectorManager ByteBufferPool bufferPool = factory.getBufferPool(); ScheduledExecutorService scheduler = factory.getScheduler(); - WebSocketAsyncConnection connection = new WebSocketAsyncConnection(endPoint,executor,scheduler,policy,bufferPool); + WebSocketAsyncConnection connection = new WebSocketClientAsyncConnection(endPoint,executor,scheduler,policy,bufferPool,factory); endPoint.setAsyncConnection(connection); connection.getParser().setIncomingFramesHandler(websocket); @@ -137,7 +138,7 @@ public class WebSocketClientSelectorManager extends SelectorManager @Override protected SelectChannelEndPoint newEndPoint(SocketChannel channel, ManagedSelector selectSet, SelectionKey selectionKey) throws IOException { - return new SelectChannelEndPoint(channel,selectSet, selectionKey, scheduler, policy.getIdleTimeout()); + return new SelectChannelEndPoint(channel,selectSet,selectionKey,scheduler,policy.getIdleTimeout()); } public SSLEngine newSSLEngine(SslContextFactory sslContextFactory, SocketChannel channel)