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, getProcessor, getProcessorSelector, getSystemInheritedChannel, setProcessor, setProcessorSelector, unbindAll
public TCPNIOServerConnection bind(SocketAddress socketAddress) throws IOException
SocketBinder
socketAddress
- the local address the server will bind toConnection
IOException
public TCPNIOServerConnection bind(SocketAddress socketAddress, int backlog) throws IOException
SocketBinder
socketAddress
- the local address the server will bind tobacklog
- the maximum length of the queueConnection
IOException
public TCPNIOServerConnection bindToInherited() throws IOException
SocketBinder
Connection
IOException
public void unbind(Connection connection)
SocketBinder
Transport
connection.connection
- Connection
public static TCPNIOBindingHandler.Builder builder(TCPNIOTransport transport)
Copyright © 2015 Oracle Corporation. All rights reserved.