Class DatagramAcceptorDelegate
java.lang.Object
org.apache.mina.common.support.BaseIoService
org.apache.mina.common.support.BaseIoAcceptor
org.apache.mina.transport.socket.nio.support.DatagramAcceptorDelegate
- All Implemented Interfaces:
IoAcceptor
,IoService
IoAcceptor
for datagram transport (UDP/IP).-
Constructor Summary
ConstructorsConstructorDescriptionDatagramAcceptorDelegate
(IoAcceptor wrapper, Executor executor) Creates a new instance. -
Method Summary
Modifier and TypeMethodDescriptionvoid
bind
(SocketAddress address, IoHandler handler, IoServiceConfig config) Binds to the specifiedaddress
and handles incoming connections with the specifiedhandler
.void
closeSession
(org.apache.mina.transport.socket.nio.support.DatagramSessionImpl session) void
flushSession
(org.apache.mina.transport.socket.nio.support.DatagramSessionImpl session) Returns the default configuration which is used when you didn't specify any configuration.newSession
(SocketAddress remoteAddress, SocketAddress localAddress) (Optional) Returns anIoSession
that is bound to the specified localAddress and remoteAddress which reuses the localAddress that is already bound byIoAcceptor
viaIoAcceptor.bind(SocketAddress, IoHandler)
.void
setDefaultConfig
(DatagramAcceptorConfig defaultConfig) Sets the config this acceptor will use by default.void
unbind
(SocketAddress address) Unbinds from the specifiedaddress
and disconnects all clients connected there.void
Unbinds all addresses which were bound by this acceptor.void
updateTrafficMask
(org.apache.mina.transport.socket.nio.support.DatagramSessionImpl session) Methods inherited from class org.apache.mina.common.support.BaseIoAcceptor
bind
Methods inherited from class org.apache.mina.common.support.BaseIoService
addListener, getFilterChain, getFilterChainBuilder, getManagedServiceAddresses, getManagedSessions, isManaged, removeListener, setFilterChainBuilder
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.apache.mina.common.IoAcceptor
bind
Methods inherited from interface org.apache.mina.common.IoService
addListener, getFilterChain, getFilterChainBuilder, getManagedServiceAddresses, getManagedSessions, isManaged, removeListener, setFilterChainBuilder
-
Constructor Details
-
DatagramAcceptorDelegate
Creates a new instance.
-
-
Method Details
-
bind
public void bind(SocketAddress address, IoHandler handler, IoServiceConfig config) throws IOException Description copied from interface:IoAcceptor
Binds to the specifiedaddress
and handles incoming connections with the specifiedhandler
.- Specified by:
bind
in interfaceIoAcceptor
- Parameters:
config
- the configuration- Throws:
IOException
- if failed to bind
-
unbind
Description copied from interface:IoAcceptor
Unbinds from the specifiedaddress
and disconnects all clients connected there.- Specified by:
unbind
in interfaceIoAcceptor
-
unbindAll
public void unbindAll()Description copied from interface:IoAcceptor
Unbinds all addresses which were bound by this acceptor.- Specified by:
unbindAll
in interfaceIoAcceptor
-
newSession
Description copied from interface:IoAcceptor
(Optional) Returns anIoSession
that is bound to the specified localAddress and remoteAddress which reuses the localAddress that is already bound byIoAcceptor
viaIoAcceptor.bind(SocketAddress, IoHandler)
.This operation is optional. Please throw
UnsupportedOperationException
if the transport type doesn't support this operation. This operation is usually implemented for connectionless transport types.- Specified by:
newSession
in interfaceIoAcceptor
- Overrides:
newSession
in classBaseIoAcceptor
-
getListeners
- Overrides:
getListeners
in classBaseIoService
-
getDefaultConfig
Description copied from interface:IoService
Returns the default configuration which is used when you didn't specify any configuration.- Specified by:
getDefaultConfig
in interfaceIoService
-
setDefaultConfig
Sets the config this acceptor will use by default.- Parameters:
defaultConfig
- the default config.- Throws:
NullPointerException
- if the specified value isnull
.
-
flushSession
public void flushSession(org.apache.mina.transport.socket.nio.support.DatagramSessionImpl session) -
closeSession
public void closeSession(org.apache.mina.transport.socket.nio.support.DatagramSessionImpl session) -
updateTrafficMask
public void updateTrafficMask(org.apache.mina.transport.socket.nio.support.DatagramSessionImpl session)
-