public class TCPNIOBindingHandler extends AbstractBindingHandler
Processor and/or
ProcessorSelector atomically within a bind operation - not something that can normally
be done using the TCPNIOTransport alone.
Example usage:
TCPNIOBindingHandler handler = TCPNIOBindingHandler.builder(transport).setProcessor(custom).build(); handler.bind(socketAddress);
| Modifier and Type | Class and Description |
|---|---|
static class |
TCPNIOBindingHandler.Builder |
processor, processorSelector, RANDOM, transport| Modifier and Type | Method and Description |
|---|---|
TCPNIOServerConnection |
bind(SocketAddress socketAddress)
Binds Transport to the specific SocketAddress.
|
TCPNIOServerConnection |
bind(SocketAddress socketAddress,
int backlog)
Binds Transport to the specific SocketAddress.
|
TCPNIOServerConnection |
bindToInherited()
Binds the Transport to the channel inherited from the entity that created this Java virtual machine.
|
static TCPNIOBindingHandler.Builder |
builder(TCPNIOTransport transport) |
void |
unbind(Connection connection)
Unbinds bound
Transport connection. |
bind, bind, bind, bind, bind, getProcessor, getProcessorSelector, getSystemInheritedChannel, setProcessor, setProcessorSelector, unbindAllpublic TCPNIOServerConnection bind(SocketAddress socketAddress) throws IOException
SocketBindersocketAddress - the local address the server will bind toConnectionIOException - if unable to bind i.e. if port already boundpublic TCPNIOServerConnection bind(SocketAddress socketAddress, int backlog) throws IOException
SocketBindersocketAddress - the local address the server will bind tobacklog - the maximum length of the queueConnectionIOException - if unable to bind i.e. if port already boundpublic TCPNIOServerConnection bindToInherited() throws IOException
SocketBinderConnectionIOException - if unable to bind i.e. if port already boundpublic void unbind(Connection connection)
SocketBinderTransport connection.connection - Connectionpublic static TCPNIOBindingHandler.Builder builder(TCPNIOTransport transport)
Copyright © 2017–2020 Oracle Corporation. All rights reserved.