org.glassfish.grizzly.nio.transport
Class UDPNIOConnectorHandler

java.lang.Object
  extended by org.glassfish.grizzly.AbstractSocketConnectorHandler
      extended by 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
static class UDPNIOConnectorHandler.Builder
           
 
Field Summary
protected  long connectionTimeoutMillis
           
protected static int DEFAULT_CONNECTION_TIMEOUT
           
protected  boolean isReuseAddress
           
 
Fields inherited from class org.glassfish.grizzly.AbstractSocketConnectorHandler
probes, transport
 
Constructor Summary
protected UDPNIOConnectorHandler(UDPNIOTransport transport)
           
 
Method Summary
static UDPNIOConnectorHandler.Builder builder(UDPNIOTransport transport)
          Return the UDPNIOConnectorHandler builder.
 GrizzlyFuture<Connection> connect()
          Creates non-connected UDP Connection.
 void connect(SocketAddress remoteAddress, SocketAddress localAddress, CompletionHandler<Connection> completionHandler)
          Creates, initializes socket, binds it to the specific local and remote SocketAddress and returns Connection, representing socket.
protected  FutureImpl<Connection> connectAsync(SocketAddress remoteAddress, SocketAddress localAddress, CompletionHandler<Connection> completionHandler, boolean needFuture)
           
protected  void connectSync(SocketAddress remoteAddress, SocketAddress localAddress, CompletionHandler<Connection> completionHandler)
           
 long getSyncConnectTimeout(TimeUnit timeUnit)
           
 boolean isReuseAddress()
           
 void setReuseAddress(boolean isReuseAddress)
           
 void setSyncConnectTimeout(long timeout, TimeUnit timeUnit)
           
protected  void waitNIOFuture(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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_CONNECTION_TIMEOUT

protected static final int DEFAULT_CONNECTION_TIMEOUT
See Also:
Constant Field Values

isReuseAddress

protected boolean isReuseAddress

connectionTimeoutMillis

protected volatile long connectionTimeoutMillis
Constructor Detail

UDPNIOConnectorHandler

protected UDPNIOConnectorHandler(UDPNIOTransport transport)
Method Detail

connect

public GrizzlyFuture<Connection> connect()
Creates non-connected UDP Connection.

Returns:
non-connected UDP Connection.

connect

public void connect(SocketAddress remoteAddress,
                    SocketAddress localAddress,
                    CompletionHandler<Connection> completionHandler)
Description copied from interface: ConnectorHandler
Creates, initializes socket, binds it to the specific local and remote SocketAddress and returns Connection, representing socket.

Specified by:
connect in interface ConnectorHandler<SocketAddress>
Overrides:
connect in class AbstractSocketConnectorHandler
Parameters:
remoteAddress - remote address to connect to.
localAddress - local address to bind socket to.
completionHandler - 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:
connectAsync in class AbstractSocketConnectorHandler

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 the UDPNIOConnectorHandler builder.

Parameters:
transport - UDPNIOTransport.
Returns:
the UDPNIOConnectorHandler builder.


Copyright © 2013 Oracle Corporation. All Rights Reserved.