public final class NioDatagramAcceptor extends AbstractPollingConnectionlessIoAcceptor<NioSession,java.nio.channels.DatagramChannel> implements DatagramAcceptor
IoAcceptor
for datagram transport (UDP/IP).AbstractIoAcceptor.AcceptorOperationFuture
AbstractIoService.ServiceOperationFuture
bindLock
disposalLock
Constructor and Description |
---|
NioDatagramAcceptor()
Creates a new instance.
|
NioDatagramAcceptor(java.util.concurrent.Executor executor)
Creates a new instance.
|
Modifier and Type | Method and Description |
---|---|
protected void |
close(java.nio.channels.DatagramChannel handle) |
protected void |
destroy() |
java.net.InetSocketAddress |
getDefaultLocalAddress()
Returns the default local address to bind when no argument is specified
in
IoAcceptor.bind() method. |
java.net.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(java.nio.channels.DatagramChannel handle) |
protected boolean |
isWritable(java.nio.channels.DatagramChannel handle) |
protected java.net.SocketAddress |
localAddress(java.nio.channels.DatagramChannel handle) |
protected NioSession |
newSession(IoProcessor<NioSession> processor,
java.nio.channels.DatagramChannel handle,
java.net.SocketAddress remoteAddress) |
protected java.nio.channels.DatagramChannel |
open(java.net.SocketAddress localAddress) |
protected java.net.SocketAddress |
receive(java.nio.channels.DatagramChannel handle,
IoBuffer buffer) |
protected int |
select() |
protected int |
select(long timeout) |
protected java.util.Iterator<java.nio.channels.DatagramChannel> |
selectedHandles() |
protected int |
send(NioSession session,
IoBuffer buffer,
java.net.SocketAddress remoteAddress) |
void |
setDefaultLocalAddress(java.net.InetSocketAddress localAddress) |
protected void |
setInterestedInWrite(NioSession session,
boolean isInterested) |
protected void |
wakeup() |
bindInternal, dispose0, getSessionRecycler, newSession, setSessionRecycler, unbind0
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, 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
public NioDatagramAcceptor()
public NioDatagramAcceptor(java.util.concurrent.Executor executor)
protected void init() throws java.lang.Exception
init
in class AbstractPollingConnectionlessIoAcceptor<NioSession,java.nio.channels.DatagramChannel>
java.lang.Exception
protected void destroy() throws java.lang.Exception
destroy
in class AbstractPollingConnectionlessIoAcceptor<NioSession,java.nio.channels.DatagramChannel>
java.lang.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 java.net.InetSocketAddress getLocalAddress()
AbstractIoAcceptor
getLocalAddress
in interface IoAcceptor
getLocalAddress
in interface DatagramAcceptor
getLocalAddress
in class AbstractIoAcceptor
public java.net.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(java.net.InetSocketAddress localAddress)
setDefaultLocalAddress
in interface DatagramAcceptor
protected java.nio.channels.DatagramChannel open(java.net.SocketAddress localAddress) throws java.lang.Exception
open
in class AbstractPollingConnectionlessIoAcceptor<NioSession,java.nio.channels.DatagramChannel>
java.lang.Exception
protected boolean isReadable(java.nio.channels.DatagramChannel handle)
isReadable
in class AbstractPollingConnectionlessIoAcceptor<NioSession,java.nio.channels.DatagramChannel>
protected boolean isWritable(java.nio.channels.DatagramChannel handle)
isWritable
in class AbstractPollingConnectionlessIoAcceptor<NioSession,java.nio.channels.DatagramChannel>
protected java.net.SocketAddress localAddress(java.nio.channels.DatagramChannel handle) throws java.lang.Exception
localAddress
in class AbstractPollingConnectionlessIoAcceptor<NioSession,java.nio.channels.DatagramChannel>
java.lang.Exception
protected NioSession newSession(IoProcessor<NioSession> processor, java.nio.channels.DatagramChannel handle, java.net.SocketAddress remoteAddress)
newSession
in class AbstractPollingConnectionlessIoAcceptor<NioSession,java.nio.channels.DatagramChannel>
protected java.net.SocketAddress receive(java.nio.channels.DatagramChannel handle, IoBuffer buffer) throws java.lang.Exception
receive
in class AbstractPollingConnectionlessIoAcceptor<NioSession,java.nio.channels.DatagramChannel>
java.lang.Exception
protected int select() throws java.lang.Exception
select
in class AbstractPollingConnectionlessIoAcceptor<NioSession,java.nio.channels.DatagramChannel>
java.lang.Exception
protected int select(long timeout) throws java.lang.Exception
select
in class AbstractPollingConnectionlessIoAcceptor<NioSession,java.nio.channels.DatagramChannel>
java.lang.Exception
protected java.util.Iterator<java.nio.channels.DatagramChannel> selectedHandles()
selectedHandles
in class AbstractPollingConnectionlessIoAcceptor<NioSession,java.nio.channels.DatagramChannel>
protected int send(NioSession session, IoBuffer buffer, java.net.SocketAddress remoteAddress) throws java.lang.Exception
send
in class AbstractPollingConnectionlessIoAcceptor<NioSession,java.nio.channels.DatagramChannel>
java.lang.Exception
protected void setInterestedInWrite(NioSession session, boolean isInterested) throws java.lang.Exception
setInterestedInWrite
in class AbstractPollingConnectionlessIoAcceptor<NioSession,java.nio.channels.DatagramChannel>
java.lang.Exception
protected void close(java.nio.channels.DatagramChannel handle) throws java.lang.Exception
close
in class AbstractPollingConnectionlessIoAcceptor<NioSession,java.nio.channels.DatagramChannel>
java.lang.Exception
protected void wakeup()
wakeup
in class AbstractPollingConnectionlessIoAcceptor<NioSession,java.nio.channels.DatagramChannel>
Copyright © 2004-2019 Apache MINA Project. All Rights Reserved.