java.lang.Object
org.glassfish.grizzly.AbstractBindingHandler
org.glassfish.grizzly.nio.transport.TCPNIOBindingHandler
- All Implemented Interfaces:
SocketBinder
This class may be used to apply a custom
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);
- Since:
- 2.2.19
-
Nested Class Summary
Nested Classes -
Field Summary
Fields inherited from class org.glassfish.grizzly.AbstractBindingHandler
processor, processorSelector, RANDOM, transport -
Method Summary
Modifier and TypeMethodDescriptionbind(SocketAddress socketAddress) Binds Transport to the specific SocketAddress.bind(SocketAddress socketAddress, int backlog) Binds Transport to the specific SocketAddress.Binds the Transport to the channel inherited from the entity that created this Java virtual machine.static TCPNIOBindingHandler.Builderbuilder(TCPNIOTransport 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
-
Method Details
-
bind
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
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
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
Description copied from interface:SocketBinderUnbinds boundTransportconnection.- Parameters:
connection-Connection
-
builder
-