Skip to content

Commit

Permalink
Implement new buffer management API
Browse files Browse the repository at this point in the history
This replaces the deprecated XNIO Pooled<> API
  • Loading branch information
stuartwdouglas committed Sep 2, 2015
1 parent f111d55 commit b62c3f1
Show file tree
Hide file tree
Showing 201 changed files with 1,893 additions and 1,485 deletions.
10 changes: 4 additions & 6 deletions core/src/main/java/io/undertow/Undertow.java
Expand Up @@ -19,21 +19,20 @@
package io.undertow; package io.undertow;


import io.undertow.protocols.ssl.UndertowXnioSsl; import io.undertow.protocols.ssl.UndertowXnioSsl;
import io.undertow.server.DefaultByteBufferPool;
import io.undertow.server.HttpHandler; import io.undertow.server.HttpHandler;
import io.undertow.server.protocol.ajp.AjpOpenListener; import io.undertow.server.protocol.ajp.AjpOpenListener;
import io.undertow.server.protocol.http.AlpnOpenListener; import io.undertow.server.protocol.http.AlpnOpenListener;
import io.undertow.server.protocol.http.HttpOpenListener; import io.undertow.server.protocol.http.HttpOpenListener;
import io.undertow.server.protocol.http2.Http2OpenListener; import io.undertow.server.protocol.http2.Http2OpenListener;
import io.undertow.server.protocol.spdy.SpdyOpenListener; import io.undertow.server.protocol.spdy.SpdyOpenListener;
import org.xnio.BufferAllocator;
import org.xnio.ByteBufferSlicePool;
import org.xnio.ChannelListener; import org.xnio.ChannelListener;
import org.xnio.ChannelListeners; import org.xnio.ChannelListeners;
import org.xnio.IoUtils; import org.xnio.IoUtils;
import org.xnio.Option; import org.xnio.Option;
import org.xnio.OptionMap; import org.xnio.OptionMap;
import org.xnio.Options; import org.xnio.Options;
import org.xnio.Pool; import io.undertow.connector.ByteBufferPool;
import org.xnio.StreamConnection; import org.xnio.StreamConnection;
import org.xnio.Xnio; import org.xnio.Xnio;
import org.xnio.XnioWorker; import org.xnio.XnioWorker;
Expand All @@ -46,7 +45,6 @@
import javax.net.ssl.TrustManager; import javax.net.ssl.TrustManager;
import java.net.Inet4Address; import java.net.Inet4Address;
import java.net.InetSocketAddress; import java.net.InetSocketAddress;
import java.nio.ByteBuffer;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;


Expand Down Expand Up @@ -119,7 +117,7 @@ public synchronized void start() {
.getMap(); .getMap();




Pool<ByteBuffer> buffers = new ByteBufferSlicePool(directBuffers ? BufferAllocator.DIRECT_BYTE_BUFFER_ALLOCATOR : BufferAllocator.BYTE_BUFFER_ALLOCATOR, bufferSize, bufferSize * buffersPerRegion); ByteBufferPool buffers = new DefaultByteBufferPool(directBuffers, bufferSize, -1, 4);


for (ListenerConfig listener : listeners) { for (ListenerConfig listener : listeners) {
final HttpHandler rootHandler = listener.rootHandler != null ? listener.rootHandler : this.rootHandler; final HttpHandler rootHandler = listener.rootHandler != null ? listener.rootHandler : this.rootHandler;
Expand Down Expand Up @@ -150,7 +148,7 @@ public synchronized void start() {
if(spdy || http2) { if(spdy || http2) {
AlpnOpenListener alpn = new AlpnOpenListener(buffers, undertowOptions, httpOpenListener); AlpnOpenListener alpn = new AlpnOpenListener(buffers, undertowOptions, httpOpenListener);
if(spdy) { if(spdy) {
SpdyOpenListener spdyListener = new SpdyOpenListener(buffers, new ByteBufferSlicePool(BufferAllocator.BYTE_BUFFER_ALLOCATOR, 1024, 1024), undertowOptions); SpdyOpenListener spdyListener = new SpdyOpenListener(buffers, new DefaultByteBufferPool(false, 1024, -1, 2, 0), undertowOptions);
spdyListener.setRootHandler(rootHandler); spdyListener.setRootHandler(rootHandler);
alpn.addProtocol(SpdyOpenListener.SPDY_3_1, spdyListener, 5); alpn.addProtocol(SpdyOpenListener.SPDY_3_1, spdyListener, 5);
} }
Expand Down
3 changes: 3 additions & 0 deletions core/src/main/java/io/undertow/UndertowMessages.java
Expand Up @@ -419,4 +419,7 @@ public interface UndertowMessages {


@Message(id = 130, value = "HTTP reason phrase was too large for the buffer. Either provide a smaller message or a bigger buffer. Phrase: %s") @Message(id = 130, value = "HTTP reason phrase was too large for the buffer. Either provide a smaller message or a bigger buffer. Phrase: %s")
IllegalStateException reasonPhraseToLargeForBuffer(String phrase); IllegalStateException reasonPhraseToLargeForBuffer(String phrase);

@Message(id = 131, value = "Buffer pool is closed")
IllegalStateException poolIsClosed();
} }
5 changes: 2 additions & 3 deletions core/src/main/java/io/undertow/client/ClientConnection.java
Expand Up @@ -20,14 +20,13 @@


import org.xnio.ChannelListener; import org.xnio.ChannelListener;
import org.xnio.Option; import org.xnio.Option;
import org.xnio.Pool; import io.undertow.connector.ByteBufferPool;
import org.xnio.StreamConnection; import org.xnio.StreamConnection;
import org.xnio.XnioIoThread; import org.xnio.XnioIoThread;
import org.xnio.XnioWorker; import org.xnio.XnioWorker;


import java.io.IOException; import java.io.IOException;
import java.net.SocketAddress; import java.net.SocketAddress;
import java.nio.ByteBuffer;
import java.nio.channels.Channel; import java.nio.channels.Channel;


/** /**
Expand Down Expand Up @@ -69,7 +68,7 @@ public interface ClientConnection extends Channel {
* *
* @return The buffer pool used by the client * @return The buffer pool used by the client
*/ */
Pool<ByteBuffer> getBufferPool(); ByteBufferPool getBufferPool();


SocketAddress getPeerAddress(); SocketAddress getPeerAddress();


Expand Down
11 changes: 5 additions & 6 deletions core/src/main/java/io/undertow/client/ClientProvider.java
Expand Up @@ -19,14 +19,13 @@
package io.undertow.client; package io.undertow.client;


import org.xnio.OptionMap; import org.xnio.OptionMap;
import org.xnio.Pool; import io.undertow.connector.ByteBufferPool;
import org.xnio.XnioIoThread; import org.xnio.XnioIoThread;
import org.xnio.XnioWorker; import org.xnio.XnioWorker;
import org.xnio.ssl.XnioSsl; import org.xnio.ssl.XnioSsl;


import java.net.InetSocketAddress; import java.net.InetSocketAddress;
import java.net.URI; import java.net.URI;
import java.nio.ByteBuffer;
import java.util.Set; import java.util.Set;


/** /**
Expand All @@ -39,12 +38,12 @@ public interface ClientProvider {


Set<String> handlesSchemes(); Set<String> handlesSchemes();


void connect(final ClientCallback<ClientConnection> listener, final URI uri, final XnioWorker worker, XnioSsl ssl, Pool<ByteBuffer> bufferPool, OptionMap options); void connect(final ClientCallback<ClientConnection> listener, final URI uri, final XnioWorker worker, XnioSsl ssl, ByteBufferPool bufferPool, OptionMap options);


void connect(final ClientCallback<ClientConnection> listener, InetSocketAddress bindAddress, final URI uri, final XnioWorker worker, XnioSsl ssl, Pool<ByteBuffer> bufferPool, OptionMap options); void connect(final ClientCallback<ClientConnection> listener, InetSocketAddress bindAddress, final URI uri, final XnioWorker worker, XnioSsl ssl, ByteBufferPool bufferPool, OptionMap options);


void connect(final ClientCallback<ClientConnection> listener, final URI uri, final XnioIoThread ioThread, XnioSsl ssl, Pool<ByteBuffer> bufferPool, OptionMap options); void connect(final ClientCallback<ClientConnection> listener, final URI uri, final XnioIoThread ioThread, XnioSsl ssl, ByteBufferPool bufferPool, OptionMap options);


void connect(final ClientCallback<ClientConnection> listener, InetSocketAddress bindAddress, final URI uri, final XnioIoThread ioThread, XnioSsl ssl, Pool<ByteBuffer> bufferPool, OptionMap options); void connect(final ClientCallback<ClientConnection> listener, InetSocketAddress bindAddress, final URI uri, final XnioIoThread ioThread, XnioSsl ssl, ByteBufferPool bufferPool, OptionMap options);


} }
35 changes: 17 additions & 18 deletions core/src/main/java/io/undertow/client/UndertowClient.java
Expand Up @@ -21,15 +21,14 @@
import org.xnio.FutureResult; import org.xnio.FutureResult;
import org.xnio.IoFuture; import org.xnio.IoFuture;
import org.xnio.OptionMap; import org.xnio.OptionMap;
import org.xnio.Pool; import io.undertow.connector.ByteBufferPool;
import org.xnio.XnioIoThread; import org.xnio.XnioIoThread;
import org.xnio.XnioWorker; import org.xnio.XnioWorker;
import org.xnio.ssl.XnioSsl; import org.xnio.ssl.XnioSsl;


import java.io.IOException; import java.io.IOException;
import java.net.InetSocketAddress; import java.net.InetSocketAddress;
import java.net.URI; import java.net.URI;
import java.nio.ByteBuffer;
import java.util.Collections; import java.util.Collections;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
Expand Down Expand Up @@ -62,19 +61,19 @@ private UndertowClient(final ClassLoader classLoader) {
this.clientProviders = Collections.unmodifiableMap(map); this.clientProviders = Collections.unmodifiableMap(map);
} }


public IoFuture<ClientConnection> connect(final URI uri, final XnioWorker worker, Pool<ByteBuffer> bufferPool, OptionMap options) { public IoFuture<ClientConnection> connect(final URI uri, final XnioWorker worker, ByteBufferPool bufferPool, OptionMap options) {
return connect(uri, worker, null, bufferPool, options); return connect(uri, worker, null, bufferPool, options);
} }


public IoFuture<ClientConnection> connect(InetSocketAddress bindAddress, final URI uri, final XnioWorker worker, Pool<ByteBuffer> bufferPool, OptionMap options) { public IoFuture<ClientConnection> connect(InetSocketAddress bindAddress, final URI uri, final XnioWorker worker, ByteBufferPool bufferPool, OptionMap options) {
return connect(bindAddress, uri, worker, null, bufferPool, options); return connect(bindAddress, uri, worker, null, bufferPool, options);
} }


public IoFuture<ClientConnection> connect(final URI uri, final XnioWorker worker, XnioSsl ssl, Pool<ByteBuffer> bufferPool, OptionMap options) { public IoFuture<ClientConnection> connect(final URI uri, final XnioWorker worker, XnioSsl ssl, ByteBufferPool bufferPool, OptionMap options) {
return connect((InetSocketAddress) null, uri, worker, ssl, bufferPool, options); return connect((InetSocketAddress) null, uri, worker, ssl, bufferPool, options);
} }


public IoFuture<ClientConnection> connect(InetSocketAddress bindAddress, final URI uri, final XnioWorker worker, XnioSsl ssl, Pool<ByteBuffer> bufferPool, OptionMap options) { public IoFuture<ClientConnection> connect(InetSocketAddress bindAddress, final URI uri, final XnioWorker worker, XnioSsl ssl, ByteBufferPool bufferPool, OptionMap options) {
ClientProvider provider = getClientProvider(uri); ClientProvider provider = getClientProvider(uri);
final FutureResult<ClientConnection> result = new FutureResult<>(); final FutureResult<ClientConnection> result = new FutureResult<>();
provider.connect(new ClientCallback<ClientConnection>() { provider.connect(new ClientCallback<ClientConnection>() {
Expand All @@ -91,20 +90,20 @@ public void failed(IOException e) {
return result.getIoFuture(); return result.getIoFuture();
} }


public IoFuture<ClientConnection> connect(final URI uri, final XnioIoThread ioThread, Pool<ByteBuffer> bufferPool, OptionMap options) { public IoFuture<ClientConnection> connect(final URI uri, final XnioIoThread ioThread, ByteBufferPool bufferPool, OptionMap options) {
return connect((InetSocketAddress) null, uri, ioThread, null, bufferPool, options); return connect((InetSocketAddress) null, uri, ioThread, null, bufferPool, options);
} }




public IoFuture<ClientConnection> connect(InetSocketAddress bindAddress, final URI uri, final XnioIoThread ioThread, Pool<ByteBuffer> bufferPool, OptionMap options) { public IoFuture<ClientConnection> connect(InetSocketAddress bindAddress, final URI uri, final XnioIoThread ioThread, ByteBufferPool bufferPool, OptionMap options) {
return connect(bindAddress, uri, ioThread, null, bufferPool, options); return connect(bindAddress, uri, ioThread, null, bufferPool, options);
} }


public IoFuture<ClientConnection> connect(final URI uri, final XnioIoThread ioThread, XnioSsl ssl, Pool<ByteBuffer> bufferPool, OptionMap options) { public IoFuture<ClientConnection> connect(final URI uri, final XnioIoThread ioThread, XnioSsl ssl, ByteBufferPool bufferPool, OptionMap options) {
return connect((InetSocketAddress) null, uri, ioThread, ssl, bufferPool, options); return connect((InetSocketAddress) null, uri, ioThread, ssl, bufferPool, options);
} }


public IoFuture<ClientConnection> connect(InetSocketAddress bindAddress, final URI uri, final XnioIoThread ioThread, XnioSsl ssl, Pool<ByteBuffer> bufferPool, OptionMap options) { public IoFuture<ClientConnection> connect(InetSocketAddress bindAddress, final URI uri, final XnioIoThread ioThread, XnioSsl ssl, ByteBufferPool bufferPool, OptionMap options) {
ClientProvider provider = getClientProvider(uri); ClientProvider provider = getClientProvider(uri);
final FutureResult<ClientConnection> result = new FutureResult<>(); final FutureResult<ClientConnection> result = new FutureResult<>();
provider.connect(new ClientCallback<ClientConnection>() { provider.connect(new ClientCallback<ClientConnection>() {
Expand All @@ -121,39 +120,39 @@ public void failed(IOException e) {
return result.getIoFuture(); return result.getIoFuture();
} }


public void connect(final ClientCallback<ClientConnection> listener, final URI uri, final XnioWorker worker, Pool<ByteBuffer> bufferPool, OptionMap options) { public void connect(final ClientCallback<ClientConnection> listener, final URI uri, final XnioWorker worker, ByteBufferPool bufferPool, OptionMap options) {
connect(listener, uri, worker, null, bufferPool, options); connect(listener, uri, worker, null, bufferPool, options);
} }


public void connect(final ClientCallback<ClientConnection> listener, InetSocketAddress bindAddress, final URI uri, final XnioWorker worker, Pool<ByteBuffer> bufferPool, OptionMap options) { public void connect(final ClientCallback<ClientConnection> listener, InetSocketAddress bindAddress, final URI uri, final XnioWorker worker, ByteBufferPool bufferPool, OptionMap options) {
connect(listener, bindAddress, uri, worker, null, bufferPool, options); connect(listener, bindAddress, uri, worker, null, bufferPool, options);
} }


public void connect(final ClientCallback<ClientConnection> listener, final URI uri, final XnioWorker worker, XnioSsl ssl, Pool<ByteBuffer> bufferPool, OptionMap options) { public void connect(final ClientCallback<ClientConnection> listener, final URI uri, final XnioWorker worker, XnioSsl ssl, ByteBufferPool bufferPool, OptionMap options) {
ClientProvider provider = getClientProvider(uri); ClientProvider provider = getClientProvider(uri);
provider.connect(listener, uri, worker, ssl, bufferPool, options); provider.connect(listener, uri, worker, ssl, bufferPool, options);
} }


public void connect(final ClientCallback<ClientConnection> listener, InetSocketAddress bindAddress, final URI uri, final XnioWorker worker, XnioSsl ssl, Pool<ByteBuffer> bufferPool, OptionMap options) { public void connect(final ClientCallback<ClientConnection> listener, InetSocketAddress bindAddress, final URI uri, final XnioWorker worker, XnioSsl ssl, ByteBufferPool bufferPool, OptionMap options) {
ClientProvider provider = getClientProvider(uri); ClientProvider provider = getClientProvider(uri);
provider.connect(listener, bindAddress, uri, worker, ssl, bufferPool, options); provider.connect(listener, bindAddress, uri, worker, ssl, bufferPool, options);
} }


public void connect(final ClientCallback<ClientConnection> listener, final URI uri, final XnioIoThread ioThread, Pool<ByteBuffer> bufferPool, OptionMap options) { public void connect(final ClientCallback<ClientConnection> listener, final URI uri, final XnioIoThread ioThread, ByteBufferPool bufferPool, OptionMap options) {
connect(listener, uri, ioThread, null, bufferPool, options); connect(listener, uri, ioThread, null, bufferPool, options);
} }




public void connect(final ClientCallback<ClientConnection> listener, InetSocketAddress bindAddress, final URI uri, final XnioIoThread ioThread, Pool<ByteBuffer> bufferPool, OptionMap options) { public void connect(final ClientCallback<ClientConnection> listener, InetSocketAddress bindAddress, final URI uri, final XnioIoThread ioThread, ByteBufferPool bufferPool, OptionMap options) {
connect(listener, bindAddress, uri, ioThread, null, bufferPool, options); connect(listener, bindAddress, uri, ioThread, null, bufferPool, options);
} }


public void connect(final ClientCallback<ClientConnection> listener, final URI uri, final XnioIoThread ioThread, XnioSsl ssl, Pool<ByteBuffer> bufferPool, OptionMap options) { public void connect(final ClientCallback<ClientConnection> listener, final URI uri, final XnioIoThread ioThread, XnioSsl ssl, ByteBufferPool bufferPool, OptionMap options) {
ClientProvider provider = getClientProvider(uri); ClientProvider provider = getClientProvider(uri);
provider.connect(listener, uri, ioThread, ssl, bufferPool, options); provider.connect(listener, uri, ioThread, ssl, bufferPool, options);
} }


public void connect(final ClientCallback<ClientConnection> listener, InetSocketAddress bindAddress, final URI uri, final XnioIoThread ioThread, XnioSsl ssl, Pool<ByteBuffer> bufferPool, OptionMap options) { public void connect(final ClientCallback<ClientConnection> listener, InetSocketAddress bindAddress, final URI uri, final XnioIoThread ioThread, XnioSsl ssl, ByteBufferPool bufferPool, OptionMap options) {
ClientProvider provider = getClientProvider(uri); ClientProvider provider = getClientProvider(uri);
provider.connect(listener, bindAddress, uri, ioThread, ssl, bufferPool, options); provider.connect(listener, bindAddress, uri, ioThread, ssl, bufferPool, options);
} }
Expand Down
Expand Up @@ -29,7 +29,6 @@
import java.io.Closeable; import java.io.Closeable;
import java.io.IOException; import java.io.IOException;
import java.net.SocketAddress; import java.net.SocketAddress;
import java.nio.ByteBuffer;
import java.util.ArrayDeque; import java.util.ArrayDeque;
import java.util.Deque; import java.util.Deque;


Expand All @@ -39,7 +38,7 @@
import org.xnio.ChannelListeners; import org.xnio.ChannelListeners;
import org.xnio.Option; import org.xnio.Option;
import org.xnio.OptionMap; import org.xnio.OptionMap;
import org.xnio.Pool; import io.undertow.connector.ByteBufferPool;
import org.xnio.StreamConnection; import org.xnio.StreamConnection;
import org.xnio.XnioIoThread; import org.xnio.XnioIoThread;
import org.xnio.XnioWorker; import org.xnio.XnioWorker;
Expand Down Expand Up @@ -85,7 +84,7 @@ public void handleEvent(AjpClientResponseStreamSourceChannel channel) {
private final OptionMap options; private final OptionMap options;
private final AjpClientChannel connection; private final AjpClientChannel connection;


private final Pool<ByteBuffer> bufferPool; private final ByteBufferPool bufferPool;


private static final int UPGRADED = 1 << 28; private static final int UPGRADED = 1 << 28;
private static final int UPGRADE_REQUESTED = 1 << 29; private static final int UPGRADE_REQUESTED = 1 << 29;
Expand All @@ -97,7 +96,7 @@ public void handleEvent(AjpClientResponseStreamSourceChannel channel) {
private final ChannelListener.SimpleSetter<AjpClientConnection> closeSetter = new ChannelListener.SimpleSetter<>(); private final ChannelListener.SimpleSetter<AjpClientConnection> closeSetter = new ChannelListener.SimpleSetter<>();
private final ClientStatistics clientStatistics; private final ClientStatistics clientStatistics;


AjpClientConnection(final AjpClientChannel connection, final OptionMap options, final Pool<ByteBuffer> bufferPool, ClientStatistics clientStatistics) { AjpClientConnection(final AjpClientChannel connection, final OptionMap options, final ByteBufferPool bufferPool, ClientStatistics clientStatistics) {
this.clientStatistics = clientStatistics; this.clientStatistics = clientStatistics;
this.options = options; this.options = options;
this.connection = connection; this.connection = connection;
Expand All @@ -114,7 +113,7 @@ public void handleEvent(AjpClientChannel channel) {
} }


@Override @Override
public Pool<ByteBuffer> getBufferPool() { public ByteBufferPool getBufferPool() {
return bufferPool; return bufferPool;
} }


Expand Down
13 changes: 6 additions & 7 deletions core/src/main/java/io/undertow/client/ajp/AjpClientProvider.java
Expand Up @@ -31,15 +31,14 @@
import org.xnio.ChannelListener; import org.xnio.ChannelListener;
import org.xnio.IoFuture; import org.xnio.IoFuture;
import org.xnio.OptionMap; import org.xnio.OptionMap;
import org.xnio.Pool; import io.undertow.connector.ByteBufferPool;
import org.xnio.StreamConnection; import org.xnio.StreamConnection;
import org.xnio.XnioIoThread; import org.xnio.XnioIoThread;
import org.xnio.XnioWorker; import org.xnio.XnioWorker;
import org.xnio.ssl.XnioSsl; import org.xnio.ssl.XnioSsl;


import java.net.InetSocketAddress; import java.net.InetSocketAddress;
import java.net.URI; import java.net.URI;
import java.nio.ByteBuffer;
import java.util.Arrays; import java.util.Arrays;
import java.util.HashSet; import java.util.HashSet;
import java.util.Set; import java.util.Set;
Expand All @@ -55,17 +54,17 @@ public Set<String> handlesSchemes() {
} }


@Override @Override
public void connect(final ClientCallback<ClientConnection> listener, final URI uri, final XnioWorker worker, final XnioSsl ssl, final Pool<ByteBuffer> bufferPool, final OptionMap options) { public void connect(final ClientCallback<ClientConnection> listener, final URI uri, final XnioWorker worker, final XnioSsl ssl, final ByteBufferPool bufferPool, final OptionMap options) {
connect(listener, null, uri, worker, ssl, bufferPool, options); connect(listener, null, uri, worker, ssl, bufferPool, options);
} }


@Override @Override
public void connect(final ClientCallback<ClientConnection> listener, final URI uri, final XnioIoThread ioThread, final XnioSsl ssl, final Pool<ByteBuffer> bufferPool, final OptionMap options) { public void connect(final ClientCallback<ClientConnection> listener, final URI uri, final XnioIoThread ioThread, final XnioSsl ssl, final ByteBufferPool bufferPool, final OptionMap options) {
connect(listener, null, uri, ioThread, ssl, bufferPool, options); connect(listener, null, uri, ioThread, ssl, bufferPool, options);
} }


@Override @Override
public void connect(final ClientCallback<ClientConnection> listener, InetSocketAddress bindAddress, final URI uri, final XnioWorker worker, final XnioSsl ssl, final Pool<ByteBuffer> bufferPool, final OptionMap options) { public void connect(final ClientCallback<ClientConnection> listener, InetSocketAddress bindAddress, final URI uri, final XnioWorker worker, final XnioSsl ssl, final ByteBufferPool bufferPool, final OptionMap options) {
ChannelListener<StreamConnection> openListener = new ChannelListener<StreamConnection>() { ChannelListener<StreamConnection> openListener = new ChannelListener<StreamConnection>() {
@Override @Override
public void handleEvent(StreamConnection connection) { public void handleEvent(StreamConnection connection) {
Expand All @@ -88,7 +87,7 @@ public void notify(IoFuture<? extends StreamConnection> ioFuture, Object o) {
} }


@Override @Override
public void connect(final ClientCallback<ClientConnection> listener, InetSocketAddress bindAddress,final URI uri, final XnioIoThread ioThread, final XnioSsl ssl, final Pool<ByteBuffer> bufferPool, final OptionMap options) { public void connect(final ClientCallback<ClientConnection> listener, InetSocketAddress bindAddress,final URI uri, final XnioIoThread ioThread, final XnioSsl ssl, final ByteBufferPool bufferPool, final OptionMap options) {
ChannelListener<StreamConnection> openListener = new ChannelListener<StreamConnection>() { ChannelListener<StreamConnection> openListener = new ChannelListener<StreamConnection>() {
@Override @Override
public void handleEvent(StreamConnection connection) { public void handleEvent(StreamConnection connection) {
Expand All @@ -110,7 +109,7 @@ public void notify(IoFuture<? extends StreamConnection> ioFuture, Object o) {
} }
} }


private void handleConnected(StreamConnection connection, ClientCallback<ClientConnection> listener, URI uri, XnioSsl ssl, Pool<ByteBuffer> bufferPool, OptionMap options) { private void handleConnected(StreamConnection connection, ClientCallback<ClientConnection> listener, URI uri, XnioSsl ssl, ByteBufferPool bufferPool, OptionMap options) {


final ClientStatisticsImpl clientStatistics; final ClientStatisticsImpl clientStatistics;
//first we set up statistics, if required //first we set up statistics, if required
Expand Down

0 comments on commit b62c3f1

Please sign in to comment.