Class UDPNIOConnectorHandler
- java.lang.Object
-
- org.glassfish.grizzly.AbstractSocketConnectorHandler
-
- org.glassfish.grizzly.nio.transport.UDPNIOConnectorHandler
-
- All Implemented Interfaces:
ConnectorHandler<SocketAddress>,SocketConnectorHandler
- Direct Known Subclasses:
UDPNIOTransport.TransportConnectorHandler
public class UDPNIOConnectorHandler extends AbstractSocketConnectorHandler
UDP NIO transport client side ConnectorHandler implementation- Author:
- Alexey Stashok
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classUDPNIOConnectorHandler.Builder
-
Field Summary
Fields Modifier and Type Field Description protected longconnectionTimeoutMillisprotected booleanisReuseAddress-
Fields inherited from class org.glassfish.grizzly.AbstractSocketConnectorHandler
probes, transport
-
Fields inherited from interface org.glassfish.grizzly.SocketConnectorHandler
DEFAULT_CONNECTION_TIMEOUT
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedUDPNIOConnectorHandler(UDPNIOTransport transport)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static UDPNIOConnectorHandler.Builderbuilder(UDPNIOTransport transport)Return theUDPNIOConnectorHandlerbuilder.GrizzlyFuture<Connection>connect()Creates non-connected UDPConnection.voidconnect(SocketAddress remoteAddress, SocketAddress localAddress, CompletionHandler<Connection> completionHandler)Creates, initializesConnection, binds it to the specific local and remoteremoteAddress.protected FutureImpl<Connection>connectAsync(SocketAddress remoteAddress, SocketAddress localAddress, CompletionHandler<Connection> completionHandler, boolean needFuture)protected voidconnectSync(SocketAddress remoteAddress, SocketAddress localAddress, CompletionHandler<Connection> completionHandler)longgetSyncConnectTimeout(TimeUnit timeUnit)booleanisReuseAddress()voidsetReuseAddress(boolean isReuseAddress)voidsetSyncConnectTimeout(long timeout, TimeUnit timeUnit)protected voidwaitNIOFuture(FutureImpl<Connection> future, CompletionHandler<Connection> completionHandler)-
Methods inherited from class org.glassfish.grizzly.AbstractSocketConnectorHandler
addMonitoringProbe, connect, connect, connect, connect, getMonitoringProbes, getProcessor, getProcessorSelector, makeCancellableFuture, preConfigure, removeMonitoringProbe, setProcessor, setProcessorSelector
-
-
-
-
Constructor Detail
-
UDPNIOConnectorHandler
protected UDPNIOConnectorHandler(UDPNIOTransport transport)
-
-
Method Detail
-
connect
public GrizzlyFuture<Connection> connect()
Creates non-connected UDPConnection.- Returns:
- non-connected UDP
Connection.
-
connect
public void connect(SocketAddress remoteAddress, SocketAddress localAddress, CompletionHandler<Connection> completionHandler)
Description copied from interface:ConnectorHandlerCreates, initializesConnection, binds it to the specific local and remoteremoteAddress.- Specified by:
connectin interfaceConnectorHandler<SocketAddress>- Overrides:
connectin classAbstractSocketConnectorHandler- Parameters:
remoteAddress- remote address to connect tolocalAddress- local address to bind aConnectiontocompletionHandler-CompletionHandler
-
connectSync
protected void connectSync(SocketAddress remoteAddress, SocketAddress localAddress, CompletionHandler<Connection> completionHandler)
-
connectAsync
protected FutureImpl<Connection> connectAsync(SocketAddress remoteAddress, SocketAddress localAddress, CompletionHandler<Connection> completionHandler, boolean needFuture)
- Specified by:
connectAsyncin classAbstractSocketConnectorHandler
-
isReuseAddress
public boolean isReuseAddress()
-
setReuseAddress
public void setReuseAddress(boolean isReuseAddress)
-
getSyncConnectTimeout
public long getSyncConnectTimeout(TimeUnit timeUnit)
-
setSyncConnectTimeout
public void setSyncConnectTimeout(long timeout, TimeUnit timeUnit)
-
waitNIOFuture
protected void waitNIOFuture(FutureImpl<Connection> future, CompletionHandler<Connection> completionHandler)
-
builder
public static UDPNIOConnectorHandler.Builder builder(UDPNIOTransport transport)
Return theUDPNIOConnectorHandlerbuilder.- Parameters:
transport-UDPNIOTransport.- Returns:
- the
UDPNIOConnectorHandlerbuilder.
-
-