public class Nio2Acceptor extends Nio2Service implements IoAcceptor
Modifier and Type | Class and Description |
---|---|
protected class |
Nio2Acceptor.AcceptCompletionHandler |
AbstractCloseable.State
Modifier and Type | Field and Description |
---|---|
protected Map<SocketAddress,AsynchronousServerSocketChannel> |
channels |
CONFIGURABLE_OPTIONS, disposing, sessions
closeFuture, lock, state
log
DEFAULT_BACKLOG
DEFAULT_REUSE_ADDRESS
CLOSE_WAIT_TIMEOUT, DEFAULT_CLOSE_WAIT_TIMEOUT
Constructor and Description |
---|
Nio2Acceptor(FactoryManager manager,
IoHandler handler,
AsynchronousChannelGroup group) |
Modifier and Type | Method and Description |
---|---|
void |
bind(Collection<? extends SocketAddress> addresses) |
void |
bind(SocketAddress address) |
protected void |
closeImmediately0() |
protected CompletionHandler<AsynchronousSocketChannel,? super SocketAddress> |
createSocketCompletionHandler(Map<SocketAddress,AsynchronousServerSocketChannel> channelsMap,
AsynchronousServerSocketChannel socket) |
Set<SocketAddress> |
getBoundAddresses() |
protected Closeable |
getInnerCloseable() |
protected AsynchronousServerSocketChannel |
openAsynchronousServerSocketChannel(SocketAddress address,
AsynchronousChannelGroup group) |
protected void |
preClose()
preClose is guaranteed to be called before doCloseGracefully or doCloseImmediately.
|
protected Closeable |
protectInProgressBinding(SocketAddress address,
AsynchronousServerSocketChannel asyncChannel) |
String |
toString() |
void |
unbind() |
void |
unbind(Collection<? extends SocketAddress> addresses) |
void |
unbind(SocketAddress address) |
dispose, getChannelGroup, getFactoryManager, getIoHandler, getIoServiceEventListener, getManagedSessions, sessionClosed, setIoServiceEventListener, setOption, setSocketOptions, unmapSession
doCloseGracefully, doCloseImmediately
addCloseFutureListener, builder, close, isClosed, isClosing, removeCloseFutureListener
getSimplifiedLogger
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getManagedSessions
addCloseFutureListener, close, close, close, getMaxCloseWaitTime, isClosed, isClosing, isOpen, removeCloseFutureListener
getIoServiceEventListener, setIoServiceEventListener
protected final Map<SocketAddress,AsynchronousServerSocketChannel> channels
public Nio2Acceptor(FactoryManager manager, IoHandler handler, AsynchronousChannelGroup group)
public void bind(Collection<? extends SocketAddress> addresses) throws IOException
bind
in interface IoAcceptor
IOException
protected Closeable protectInProgressBinding(SocketAddress address, AsynchronousServerSocketChannel asyncChannel)
protected AsynchronousServerSocketChannel openAsynchronousServerSocketChannel(SocketAddress address, AsynchronousChannelGroup group) throws IOException
IOException
protected CompletionHandler<AsynchronousSocketChannel,? super SocketAddress> createSocketCompletionHandler(Map<SocketAddress,AsynchronousServerSocketChannel> channelsMap, AsynchronousServerSocketChannel socket) throws IOException
IOException
public void bind(SocketAddress address) throws IOException
bind
in interface IoAcceptor
IOException
public void unbind()
unbind
in interface IoAcceptor
public void unbind(Collection<? extends SocketAddress> addresses)
unbind
in interface IoAcceptor
public void unbind(SocketAddress address)
unbind
in interface IoAcceptor
public Set<SocketAddress> getBoundAddresses()
getBoundAddresses
in interface IoAcceptor
protected void preClose()
AbstractCloseable
preClose
in class AbstractCloseable
protected Closeable getInnerCloseable()
getInnerCloseable
in class Nio2Service
protected void closeImmediately0()
Copyright © 2008–2022 The Apache Software Foundation. All rights reserved.