public final class NioDatagramAcceptor extends AbstractPollingConnectionlessIoAcceptor<NioSession,DatagramChannel> implements DatagramAcceptor
IoAcceptor
for datagram transport (UDP/IP).AbstractIoAcceptor.AcceptorOperationFuture
AbstractIoService.ServiceOperationFuture
bindLock
disposalLock
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
IoSession s
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, write
bind, bind, bind, bind, bind, getDefaultLocalAddresses, getLocalAddresses, isCloseOnDeactivation, setCloseOnDeactivation, setDefaultLocalAddress, setDefaultLocalAddresses, setDefaultLocalAddresses, setDefaultLocalAddresses, toString, unbind, unbind, unbind, unbind
addListener, broadcast, dispose, dispose, executeWorker, executeWorker, finishSessionInitialization0, getActivationTime, getFilterChain, getFilterChainBuilder, getHandler, getListeners, getManagedSessionCount, getManagedSessions, getScheduledWriteBytes, getScheduledWriteMessages, getSessionDataStructureFactory, getStatistics, initSession, isActive, isDisposed, isDisposing, removeListener, setFilterChainBuilder, setHandler, setSessionDataStructureFactory
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getSessionRecycler, setSessionRecycler
bind, bind, bind, bind, bind, getDefaultLocalAddresses, getLocalAddresses, isCloseOnDeactivation, newSession, setCloseOnDeactivation, setDefaultLocalAddress, setDefaultLocalAddresses, setDefaultLocalAddresses, setDefaultLocalAddresses, unbind, unbind, unbind, unbind
addListener, broadcast, dispose, dispose, getActivationTime, getFilterChain, getFilterChainBuilder, getHandler, getManagedSessionCount, getManagedSessions, getScheduledWriteBytes, getScheduledWriteMessages, getSessionDataStructureFactory, getStatistics, isActive, isDisposed, isDisposing, removeListener, setFilterChainBuilder, setHandler, setSessionDataStructureFactory
dispose, isDisposed, isDisposing
public NioDatagramAcceptor()
public NioDatagramAcceptor(Executor executor)
protected void init() throws Exception
init
in class AbstractPollingConnectionlessIoAcceptor<NioSession,DatagramChannel>
Exception
protected void destroy() throws Exception
destroy
in class AbstractPollingConnectionlessIoAcceptor<NioSession,DatagramChannel>
Exception
public TransportMetadata getTransportMetadata()
IoService
TransportMetadata
that this service runs on.getTransportMetadata
in interface IoService
public DatagramSessionConfig getSessionConfig()
AbstractIoService
IoSession
s
created by this service.getSessionConfig
in interface IoService
getSessionConfig
in class AbstractIoService
public InetSocketAddress getLocalAddress()
AbstractIoAcceptor
getLocalAddress
in interface IoAcceptor
getLocalAddress
in interface DatagramAcceptor
getLocalAddress
in class AbstractIoAcceptor
public InetSocketAddress getDefaultLocalAddress()
AbstractIoAcceptor
IoAcceptor.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 IoAcceptor
getDefaultLocalAddress
in interface DatagramAcceptor
getDefaultLocalAddress
in class AbstractIoAcceptor
public void setDefaultLocalAddress(InetSocketAddress localAddress)
setDefaultLocalAddress
in interface DatagramAcceptor
protected DatagramChannel open(SocketAddress localAddress) throws Exception
open
in class AbstractPollingConnectionlessIoAcceptor<NioSession,DatagramChannel>
Exception
protected 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>
Exception
protected 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>
Exception
protected int select() throws Exception
select
in class AbstractPollingConnectionlessIoAcceptor<NioSession,DatagramChannel>
Exception
protected int select(long timeout) throws Exception
select
in class AbstractPollingConnectionlessIoAcceptor<NioSession,DatagramChannel>
Exception
protected 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>
Exception
protected void setInterestedInWrite(NioSession session, boolean isInterested) throws Exception
setInterestedInWrite
in class AbstractPollingConnectionlessIoAcceptor<NioSession,DatagramChannel>
Exception
protected void close(DatagramChannel handle) throws Exception
close
in class AbstractPollingConnectionlessIoAcceptor<NioSession,DatagramChannel>
Exception
protected void wakeup()
wakeup
in class AbstractPollingConnectionlessIoAcceptor<NioSession,DatagramChannel>
Copyright © 2004-2012 Apache MINA Project. All Rights Reserved.