Class UDPNIOBindingHandler
- java.lang.Object
-
- org.glassfish.grizzly.AbstractBindingHandler
-
- org.glassfish.grizzly.nio.transport.UDPNIOBindingHandler
-
- All Implemented Interfaces:
SocketBinder
public class UDPNIOBindingHandler extends AbstractBindingHandler
This class may be used to apply a customProcessor
and/orProcessorSelector
atomically within a bind operation - not something that can normally be done using theUDPNIOTransport
alone. Example usage:UDPNIOBindingHandler handler = UDPNIOBindingHandler.builder(transport).setProcessor(custom).build(); handler.bind(socketAddress);
- Since:
- 2.2.19
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
UDPNIOBindingHandler.Builder
-
Field Summary
-
Fields inherited from class org.glassfish.grizzly.AbstractBindingHandler
processor, processorSelector, RANDOM, transport
-
-
Constructor Summary
Constructors Constructor Description UDPNIOBindingHandler(UDPNIOTransport udpTransport)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method 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 boundTransport
connection.-
Methods inherited from class org.glassfish.grizzly.AbstractBindingHandler
bind, bind, bind, bind, bind, getProcessor, getProcessorSelector, getSystemInheritedChannel, setProcessor, setProcessorSelector, unbindAll
-
-
-
-
Constructor Detail
-
UDPNIOBindingHandler
public UDPNIOBindingHandler(UDPNIOTransport udpTransport)
-
-
Method Detail
-
bind
public UDPNIOServerConnection bind(SocketAddress socketAddress) throws IOException
Description copied from interface:SocketBinder
Binds Transport to the specific SocketAddress.- Parameters:
socketAddress
- the local address the server will bind to- Returns:
- bound
Connection
- Throws:
IOException
- if unable to bind i.e. if port already bound
-
bind
public UDPNIOServerConnection bind(SocketAddress socketAddress, int backlog) throws IOException
Description copied from interface:SocketBinder
Binds Transport to the specific SocketAddress.- Parameters:
socketAddress
- the local address the server will bind tobacklog
- the maximum length of the queue- Returns:
- bound
Connection
- Throws:
IOException
- if unable to bind i.e. if port already bound
-
bindToInherited
public UDPNIOServerConnection bindToInherited() throws IOException
Description copied from interface:SocketBinder
Binds the Transport to the channel inherited from the entity that created this Java virtual machine.- Returns:
- bound
Connection
- Throws:
IOException
- if unable to bind i.e. if port already bound
-
unbind
public void unbind(Connection connection)
Description copied from interface:SocketBinder
Unbinds boundTransport
connection.- Parameters:
connection
-Connection
-
builder
public static UDPNIOBindingHandler.Builder builder(UDPNIOTransport transport)
-
-