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, bind, getProcessor, getProcessorSelector, getSystemInheritedChannel, setProcessor, setProcessorSelector, unbindAllpublic UDPNIOBindingHandler(UDPNIOTransport udpTransport)
public UDPNIOServerConnection bind(SocketAddress socketAddress) throws IOException
SocketBindersocketAddress - the local address the server will bind toConnectionIOException - if unable to bind i.e. if port already boundpublic UDPNIOServerConnection 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 UDPNIOServerConnection bindToInherited() throws IOException
SocketBinderConnectionIOException - if unable to bind i.e. if port already boundpublic void unbind(Connection connection)
SocketBinderTransport connection.connection - Connectionpublic static UDPNIOBindingHandler.Builder builder(UDPNIOTransport transport)
Copyright © 2017–2020 Oracle Corporation. All rights reserved.