org.glassfish.grizzly.nio.transport
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
|
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 |
DEFAULT_CONNECTION_TIMEOUT
protected static final int DEFAULT_CONNECTION_TIMEOUT
- See Also:
- Constant Field Values
isReuseAddress
protected boolean isReuseAddress
connectionTimeoutMillis
protected volatile long connectionTimeoutMillis
UDPNIOConnectorHandler
protected UDPNIOConnectorHandler(UDPNIOTransport transport)
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 © 2012 Oracle Corporation. All Rights Reserved.