public interface IoAcceptor extends IoSessionManager
Please refer to EchoServer example.
You should bind to the desired socket address to accept incoming
connections, and then events for incoming connections will be sent to
the specified default
Threads accept incoming connections start automatically when
bind(SocketAddress, IoHandler) is invoked, and stop when all
addresses are unbound.
|Modifier and Type||Method and Description|
Binds to the specified
Unbinds from the specified
void bind(java.net.SocketAddress address, IoHandler handler) throws java.io.IOException
addressand handles incoming connections with the specified
java.io.IOException- if failed to bind
void unbind(java.net.SocketAddress address)
IoSession newSession(java.net.SocketAddress remoteAddress, java.net.SocketAddress localAddress)
IoSessionthat is bound to the specified localAddress and remoteAddress which reuses the localAddress that is already bound by
This operation is optional. Please throw
if the transport type doesn't support this operation. This operation is
usually implemented for connectionless transport types.
java.lang.UnsupportedOperationException- if this operation is not supported
java.lang.IllegalArgumentException- if the specified localAddress is not bound yet. (see