public class Nio2Connector extends Nio2Service implements IoConnector
Modifier and Type | Class and Description |
---|---|
protected class |
Nio2Connector.ConnectionCompletionHandler |
static class |
Nio2Connector.DefaultIoConnectFuture |
AbstractCloseable.State
CONFIGURABLE_OPTIONS, disposing, sessions
closeFuture, lock, state
log
DEFAULT_REUSE_ADDRESS
CLOSE_WAIT_TIMEOUT, DEFAULT_CLOSE_WAIT_TIMEOUT
Constructor and Description |
---|
Nio2Connector(FactoryManager manager,
IoHandler handler,
AsynchronousChannelGroup group) |
Modifier and Type | Method and Description |
---|---|
IoConnectFuture |
connect(SocketAddress address,
AttributeRepository context,
SocketAddress localAddress) |
protected Nio2CompletionHandler<Void,Object> |
createConnectionCompletionHandler(IoConnectFuture future,
AsynchronousSocketChannel socket,
AttributeRepository context,
FactoryManager manager,
IoHandler handler) |
protected Nio2Session |
createSession(FactoryManager manager,
IoHandler handler,
AsynchronousSocketChannel socket) |
protected AsynchronousSocketChannel |
openAsynchronousSocketChannel(SocketAddress address,
AsynchronousChannelGroup group) |
dispose, getChannelGroup, getFactoryManager, getInnerCloseable, getIoHandler, getIoServiceEventListener, getManagedSessions, sessionClosed, setIoServiceEventListener, setOption, setSocketOptions, unmapSession
doCloseGracefully, doCloseImmediately
addCloseFutureListener, builder, close, isClosed, isClosing, preClose, removeCloseFutureListener
getSimplifiedLogger
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getManagedSessions
addCloseFutureListener, close, close, close, getMaxCloseWaitTime, isClosed, isClosing, isOpen, removeCloseFutureListener
getIoServiceEventListener, setIoServiceEventListener
public Nio2Connector(FactoryManager manager, IoHandler handler, AsynchronousChannelGroup group)
public IoConnectFuture connect(SocketAddress address, AttributeRepository context, SocketAddress localAddress)
connect
in interface IoConnector
address
- 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 AsynchronousSocketChannel openAsynchronousSocketChannel(SocketAddress address, AsynchronousChannelGroup group) throws IOException
IOException
protected Nio2CompletionHandler<Void,Object> createConnectionCompletionHandler(IoConnectFuture future, AsynchronousSocketChannel socket, AttributeRepository context, FactoryManager manager, IoHandler handler)
protected Nio2Session createSession(FactoryManager manager, IoHandler handler, AsynchronousSocketChannel socket) throws Throwable
Throwable
Copyright © 2008–2022 The Apache Software Foundation. All rights reserved.