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 customProcessorand/orProcessorSelectoratomically within a bind operation - not something that can normally be done using theUDPNIOTransportalone. 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 classUDPNIOBindingHandler.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 UDPNIOServerConnectionbind(SocketAddress socketAddress)Binds Transport to the specific SocketAddress.UDPNIOServerConnectionbind(SocketAddress socketAddress, int backlog)Binds Transport to the specific SocketAddress.UDPNIOServerConnectionbindToInherited()Binds the Transport to the channel inherited from the entity that created this Java virtual machine.static UDPNIOBindingHandler.Builderbuilder(UDPNIOTransport transport)voidunbind(Connection connection)Unbinds boundTransportconnection.-
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:SocketBinderBinds 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:SocketBinderBinds 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:SocketBinderBinds 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:SocketBinderUnbinds boundTransportconnection.- Parameters:
connection-Connection
-
builder
public static UDPNIOBindingHandler.Builder builder(UDPNIOTransport transport)
-
-