public class UDPNIOBindingHandler extends AbstractBindingHandler
Processor
and/or ProcessorSelector
atomically within a bind operation - not something that can normally be done using the UDPNIOTransport
alone.
Example usage:
UDPNIOBindingHandler handler = UDPNIOBindingHandler.builder(transport).setProcessor(custom).build(); handler.bind(socketAddress);
Modifier and Type | Class and Description |
---|---|
static class |
UDPNIOBindingHandler.Builder |
processor, processorSelector, RANDOM, transport
Constructor and Description |
---|
UDPNIOBindingHandler(UDPNIOTransport udpTransport) |
Modifier and Type | Method and Description |
---|---|
UDPNIOServerConnection |
bind(SocketAddress socketAddress)
Binds Transport to the specific SocketAddress.
|
UDPNIOServerConnection |
bind(SocketAddress socketAddress,
int backlog)
Binds Transport to the specific SocketAddress.
|
UDPNIOServerConnection |
bindToInherited()
Binds the Transport to the channel inherited from the entity that
created this Java virtual machine.
|
static UDPNIOBindingHandler.Builder |
builder(UDPNIOTransport transport) |
void |
unbind(Connection connection)
Unbinds bound
Transport connection. |
bind, bind, bind, bind, getProcessor, getProcessorSelector, getSystemInheritedChannel, setProcessor, setProcessorSelector, unbindAll
public UDPNIOBindingHandler(UDPNIOTransport udpTransport)
public UDPNIOServerConnection bind(SocketAddress socketAddress) throws IOException
SocketBinder
socketAddress
- the local address the server will bind toConnection
IOException
public UDPNIOServerConnection 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 UDPNIOServerConnection bindToInherited() throws IOException
SocketBinder
Connection
IOException
public void unbind(Connection connection)
SocketBinder
Transport
connection.connection
- Connection
public static UDPNIOBindingHandler.Builder builder(UDPNIOTransport transport)
Copyright © 2014 Oracle Corporation. All rights reserved.