public interface ProtocolAcceptor extends ProtocolSessionManager
Please refer to Reverser 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, ProtocolProvider) 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, ProtocolProvider protocolProvider) throws java.io.IOException
addressand handles incoming connections with the specified
java.io.IOException- if failed to bind
void unbind(java.net.SocketAddress address)
ProtocolSession newSession(java.net.SocketAddress remoteAddress, java.net.SocketAddress localAddress)
ProtocolSessionthat 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