public class Nio2Connector extends Nio2Service implements IoConnector
| Modifier and Type | Class and Description |
|---|---|
protected class |
Nio2Connector.ConnectionCompletionHandler |
static class |
Nio2Connector.DefaultIoConnectFuture |
AbstractCloseable.StateCONFIGURABLE_OPTIONS, disposing, propertyResolver, sessionscloseFuture, futureLock, statelogDEFAULT_REUSE_ADDRESS| Constructor and Description |
|---|
Nio2Connector(PropertyResolver propertyResolver,
IoHandler handler,
java.nio.channels.AsynchronousChannelGroup group,
java.util.concurrent.ExecutorService resumeTasks) |
| Modifier and Type | Method and Description |
|---|---|
IoConnectFuture |
connect(java.net.SocketAddress address,
AttributeRepository context,
java.net.SocketAddress localAddress) |
protected Nio2CompletionHandler<java.lang.Void,java.lang.Object> |
createConnectionCompletionHandler(IoConnectFuture future,
java.nio.channels.AsynchronousSocketChannel socket,
AttributeRepository context,
PropertyResolver propertyResolver,
IoHandler handler) |
protected Nio2Session |
createSession(PropertyResolver propertyResolver,
IoHandler handler,
java.nio.channels.AsynchronousSocketChannel socket) |
protected java.nio.channels.AsynchronousSocketChannel |
openAsynchronousSocketChannel(java.net.SocketAddress address,
java.nio.channels.AsynchronousChannelGroup group) |
dispose, getChannelGroup, getExecutorService, getInnerCloseable, getIoHandler, getIoServiceEventListener, getManagedSessions, sessionClosed, setIoServiceEventListener, setOption, setSocketOptions, unmapSessiondoCloseGracefully, doCloseImmediatelyaddCloseFutureListener, builder, close, getFutureLock, isClosed, isClosing, preClose, removeCloseFutureListenerdebug, debug, debug, debug, debug, error, error, error, error, error, getSimplifiedLogger, info, info, warn, warn, warn, warn, warn, warn, warn, warnclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetManagedSessionsaddCloseFutureListener, close, close, close, getMaxCloseWaitTime, isClosed, isClosing, isOpen, removeCloseFutureListenergetIoServiceEventListener, setIoServiceEventListenerpublic Nio2Connector(PropertyResolver propertyResolver, IoHandler handler, java.nio.channels.AsynchronousChannelGroup group, java.util.concurrent.ExecutorService resumeTasks)
public IoConnectFuture connect(java.net.SocketAddress address, AttributeRepository context, java.net.SocketAddress localAddress)
connect in interface IoConnectoraddress - The target address to connect tocontext - An optional "context" to be attached to the established session if successfully
connectedlocalAddress - The local address to use - if null an automatic ephemeral port and bind address is
usedfuture representing the connection requestprotected java.nio.channels.AsynchronousSocketChannel openAsynchronousSocketChannel(java.net.SocketAddress address,
java.nio.channels.AsynchronousChannelGroup group)
throws java.io.IOException
java.io.IOExceptionprotected Nio2CompletionHandler<java.lang.Void,java.lang.Object> createConnectionCompletionHandler(IoConnectFuture future, java.nio.channels.AsynchronousSocketChannel socket, AttributeRepository context, PropertyResolver propertyResolver, IoHandler handler)
protected Nio2Session createSession(PropertyResolver propertyResolver, IoHandler handler, java.nio.channels.AsynchronousSocketChannel socket) throws java.lang.Throwable
java.lang.Throwable