public class DatagramAcceptorDelegate extends BaseIoAcceptor implements IoAcceptor
IoAcceptor
for datagram transport (UDP/IP).构造器和说明 |
---|
DatagramAcceptorDelegate(IoAcceptor wrapper,
java.util.concurrent.Executor executor)
Creates a new instance.
|
限定符和类型 | 方法和说明 |
---|---|
void |
bind(java.net.SocketAddress address,
IoHandler handler,
IoServiceConfig config)
Binds to the specified
address and handles incoming
connections with the specified handler . |
void |
closeSession(org.apache.mina.transport.socket.nio.support.DatagramSessionImpl session)
Requests this processor to close the specified session.
|
void |
flushSession(org.apache.mina.transport.socket.nio.support.DatagramSessionImpl session)
Requests this processor to flush the write buffer of the specified
session.
|
DatagramAcceptorConfig |
getDefaultConfig()
Returns the default configuration which is used when you didn't specify
any configuration.
|
IoServiceListenerSupport |
getListeners() |
IoSession |
newSession(java.net.SocketAddress remoteAddress,
java.net.SocketAddress localAddress)
(Optional) Returns an
IoSession that is bound to the specified
localAddress and remoteAddress which reuses
the localAddress that is already bound by IoAcceptor
via IoAcceptor.bind(SocketAddress, IoHandler) . |
void |
setDefaultConfig(DatagramAcceptorConfig defaultConfig)
Sets the config this acceptor will use by default.
|
void |
unbind(java.net.SocketAddress address)
Unbinds from the specified
address and disconnects all clients
connected there. |
void |
unbindAll()
Unbinds all addresses which were bound by this acceptor.
|
void |
updateTrafficMask(org.apache.mina.transport.socket.nio.support.DatagramSessionImpl session)
Requests this processor to update the traffic mask for the specified
session.
|
bind
addListener, getFilterChain, getFilterChainBuilder, getManagedServiceAddresses, getManagedSessions, isManaged, removeListener, setFilterChainBuilder
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
bind
addListener, getFilterChain, getFilterChainBuilder, getManagedServiceAddresses, getManagedSessions, isManaged, removeListener, setFilterChainBuilder
public DatagramAcceptorDelegate(IoAcceptor wrapper, java.util.concurrent.Executor executor)
public void bind(java.net.SocketAddress address, IoHandler handler, IoServiceConfig config) throws java.io.IOException
IoAcceptor
address
and handles incoming
connections with the specified handler
.bind
在接口中 IoAcceptor
config
- the configurationjava.io.IOException
- if failed to bindpublic void unbind(java.net.SocketAddress address)
IoAcceptor
address
and disconnects all clients
connected there.unbind
在接口中 IoAcceptor
public void unbindAll()
IoAcceptor
unbindAll
在接口中 IoAcceptor
public IoSession newSession(java.net.SocketAddress remoteAddress, java.net.SocketAddress localAddress)
IoAcceptor
IoSession
that is bound to the specified
localAddress and remoteAddress which reuses
the localAddress that is already bound by IoAcceptor
via IoAcceptor.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.
newSession
在接口中 IoAcceptor
newSession
在类中 BaseIoAcceptor
public IoServiceListenerSupport getListeners()
getListeners
在类中 BaseIoService
public DatagramAcceptorConfig getDefaultConfig()
IoService
getDefaultConfig
在接口中 IoService
public void setDefaultConfig(DatagramAcceptorConfig defaultConfig)
defaultConfig
- the default config.java.lang.NullPointerException
- if the specified value is null
.public void flushSession(org.apache.mina.transport.socket.nio.support.DatagramSessionImpl session)
public void closeSession(org.apache.mina.transport.socket.nio.support.DatagramSessionImpl session)
public void updateTrafficMask(org.apache.mina.transport.socket.nio.support.DatagramSessionImpl session)