public class DatagramAcceptor extends BaseSessionManager implements IoAcceptor
IoAcceptor
for datagram transport (UDP/IP).exceptionMonitor
Constructor and Description |
---|
DatagramAcceptor()
Creates a new instance.
|
Modifier and Type | Method and Description |
---|---|
void |
bind(java.net.SocketAddress address,
IoHandler handler)
Binds to the specified
address and handles incoming
connections with the specified handler . |
IoFilterChain |
getFilterChain()
Returns the filter chain that filters all events which is related
with sessions this manager manages.
|
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 |
unbind(java.net.SocketAddress address)
Unbinds from the specified
address . |
getExceptionMonitor, setExceptionMonitor
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getExceptionMonitor, setExceptionMonitor
public void bind(java.net.SocketAddress address, IoHandler handler) throws java.io.IOException
IoAcceptor
address
and handles incoming
connections with the specified handler
.bind
in interface IoAcceptor
java.io.IOException
- if failed to bindpublic void unbind(java.net.SocketAddress address)
IoAcceptor
address
.unbind
in interface 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
in interface IoAcceptor
public IoFilterChain getFilterChain()
IoSessionManager
getFilterChain
in interface IoSessionManager