public final class NioDatagramAcceptor extends AbstractPollingConnectionlessIoAcceptor<NioSession,DatagramChannel> implements DatagramAcceptor
IoAcceptor for datagram transport (UDP/IP).AbstractIoAcceptor.AcceptorOperationFutureAbstractIoService.ServiceOperationFuturebindLockdisposalLock| Constructor and Description |
|---|
NioDatagramAcceptor()
Creates a new instance.
|
NioDatagramAcceptor(Executor executor)
Creates a new instance.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
close(DatagramChannel handle) |
protected void |
destroy() |
InetSocketAddress |
getDefaultLocalAddress()
Returns the default local address to bind when no argument is specified
in
IoAcceptor.bind() method. |
InetSocketAddress |
getLocalAddress()
Returns the local address which is bound currently.
|
DatagramSessionConfig |
getSessionConfig()
Returns the default configuration of the new
IoSessions
created by this service. |
TransportMetadata |
getTransportMetadata()
Returns the
TransportMetadata that this service runs on. |
protected void |
init() |
protected boolean |
isReadable(DatagramChannel handle) |
protected boolean |
isWritable(DatagramChannel handle) |
protected SocketAddress |
localAddress(DatagramChannel handle) |
protected NioSession |
newSession(IoProcessor<NioSession> processor,
DatagramChannel handle,
SocketAddress remoteAddress) |
protected DatagramChannel |
open(SocketAddress localAddress) |
protected SocketAddress |
receive(DatagramChannel handle,
IoBuffer buffer) |
protected int |
select() |
protected int |
select(long timeout) |
protected Set<SelectionKey> |
selectedHandles() |
protected int |
send(NioSession session,
IoBuffer buffer,
SocketAddress remoteAddress) |
void |
setDefaultLocalAddress(InetSocketAddress localAddress) |
protected void |
setInterestedInWrite(NioSession session,
boolean isInterested) |
protected void |
wakeup() |
add, bindInternal, dispose0, flush, getSessionRecycler, newSession, remove, setSessionRecycler, unbind0, updateTrafficControl, writebind, bind, bind, bind, bind, getDefaultLocalAddresses, getLocalAddresses, isCloseOnDeactivation, setCloseOnDeactivation, setDefaultLocalAddress, setDefaultLocalAddresses, setDefaultLocalAddresses, setDefaultLocalAddresses, toString, unbind, unbind, unbind, unbindaddListener, broadcast, dispose, dispose, executeWorker, executeWorker, finishSessionInitialization0, getActivationTime, getFilterChain, getFilterChainBuilder, getHandler, getListeners, getManagedSessionCount, getManagedSessions, getScheduledWriteBytes, getScheduledWriteMessages, getSessionDataStructureFactory, getStatistics, initSession, isActive, isDisposed, isDisposing, removeListener, setFilterChainBuilder, setHandler, setSessionDataStructureFactoryclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetSessionRecycler, setSessionRecyclerbind, bind, bind, bind, bind, getDefaultLocalAddresses, getLocalAddresses, isCloseOnDeactivation, newSession, setCloseOnDeactivation, setDefaultLocalAddress, setDefaultLocalAddresses, setDefaultLocalAddresses, setDefaultLocalAddresses, unbind, unbind, unbind, unbindaddListener, broadcast, dispose, dispose, getActivationTime, getFilterChain, getFilterChainBuilder, getHandler, getManagedSessionCount, getManagedSessions, getScheduledWriteBytes, getScheduledWriteMessages, getSessionDataStructureFactory, getStatistics, isActive, isDisposed, isDisposing, removeListener, setFilterChainBuilder, setHandler, setSessionDataStructureFactorydispose, isDisposed, isDisposingpublic NioDatagramAcceptor()
public NioDatagramAcceptor(Executor executor)
protected void init()
throws Exception
init in class AbstractPollingConnectionlessIoAcceptor<NioSession,DatagramChannel>Exceptionprotected void destroy()
throws Exception
destroy in class AbstractPollingConnectionlessIoAcceptor<NioSession,DatagramChannel>Exceptionpublic TransportMetadata getTransportMetadata()
IoServiceTransportMetadata that this service runs on.getTransportMetadata in interface IoServicepublic DatagramSessionConfig getSessionConfig()
AbstractIoServiceIoSessions
created by this service.getSessionConfig in interface IoServicegetSessionConfig in class AbstractIoServicepublic InetSocketAddress getLocalAddress()
AbstractIoAcceptorgetLocalAddress in interface IoAcceptorgetLocalAddress in interface DatagramAcceptorgetLocalAddress in class AbstractIoAcceptorpublic InetSocketAddress getDefaultLocalAddress()
AbstractIoAcceptorIoAcceptor.bind() method. Please note that the default will not be
used if any local address is specified. If more than one address are
set, only one of them will be returned, but it's not necessarily the
firstly specified address in IoAcceptor.setDefaultLocalAddresses(List).getDefaultLocalAddress in interface IoAcceptorgetDefaultLocalAddress in interface DatagramAcceptorgetDefaultLocalAddress in class AbstractIoAcceptorpublic void setDefaultLocalAddress(InetSocketAddress localAddress)
setDefaultLocalAddress in interface DatagramAcceptorprotected DatagramChannel open(SocketAddress localAddress) throws Exception
open in class AbstractPollingConnectionlessIoAcceptor<NioSession,DatagramChannel>Exceptionprotected boolean isReadable(DatagramChannel handle)
isReadable in class AbstractPollingConnectionlessIoAcceptor<NioSession,DatagramChannel>protected boolean isWritable(DatagramChannel handle)
isWritable in class AbstractPollingConnectionlessIoAcceptor<NioSession,DatagramChannel>protected SocketAddress localAddress(DatagramChannel handle) throws Exception
localAddress in class AbstractPollingConnectionlessIoAcceptor<NioSession,DatagramChannel>Exceptionprotected NioSession newSession(IoProcessor<NioSession> processor, DatagramChannel handle, SocketAddress remoteAddress)
newSession in class AbstractPollingConnectionlessIoAcceptor<NioSession,DatagramChannel>protected SocketAddress receive(DatagramChannel handle, IoBuffer buffer) throws Exception
receive in class AbstractPollingConnectionlessIoAcceptor<NioSession,DatagramChannel>Exceptionprotected int select()
throws Exception
select in class AbstractPollingConnectionlessIoAcceptor<NioSession,DatagramChannel>Exceptionprotected int select(long timeout)
throws Exception
select in class AbstractPollingConnectionlessIoAcceptor<NioSession,DatagramChannel>Exceptionprotected Set<SelectionKey> selectedHandles()
selectedHandles in class AbstractPollingConnectionlessIoAcceptor<NioSession,DatagramChannel>protected int send(NioSession session, IoBuffer buffer, SocketAddress remoteAddress) throws Exception
send in class AbstractPollingConnectionlessIoAcceptor<NioSession,DatagramChannel>Exceptionprotected void setInterestedInWrite(NioSession session, boolean isInterested) throws Exception
setInterestedInWrite in class AbstractPollingConnectionlessIoAcceptor<NioSession,DatagramChannel>Exceptionprotected void close(DatagramChannel handle) throws Exception
close in class AbstractPollingConnectionlessIoAcceptor<NioSession,DatagramChannel>Exceptionprotected void wakeup()
wakeup in class AbstractPollingConnectionlessIoAcceptor<NioSession,DatagramChannel>