org.glassfish.grizzly.nio.transport
Class UDPNIOConnectorHandler
java.lang.Object
org.glassfish.grizzly.AbstractSocketConnectorHandler
org.glassfish.grizzly.nio.transport.UDPNIOConnectorHandler
- All Implemented Interfaces:
- ConnectorHandler<java.net.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. |
GrizzlyFuture<Connection> |
connect(java.net.SocketAddress remoteAddress,
java.net.SocketAddress localAddress,
CompletionHandler<Connection> completionHandler)
Creates, initializes socket, binds it to the specific local and remote
SocketAddress and returns Connection, representing socket. |
protected GrizzlyFuture<Connection> |
connectAsync(java.net.SocketAddress remoteAddress,
java.net.SocketAddress localAddress,
CompletionHandler<Connection> completionHandler)
|
protected GrizzlyFuture<Connection> |
connectSync(java.net.SocketAddress remoteAddress,
java.net.SocketAddress localAddress,
CompletionHandler<Connection> completionHandler)
|
long |
getSyncConnectTimeout(java.util.concurrent.TimeUnit timeUnit)
|
boolean |
isReuseAddress()
|
void |
setReuseAddress(boolean isReuseAddress)
|
void |
setSyncConnectTimeout(long timeout,
java.util.concurrent.TimeUnit timeUnit)
|
protected
|
waitNIOFuture(java.util.concurrent.Future<E> future)
|
| Methods inherited from class org.glassfish.grizzly.AbstractSocketConnectorHandler |
addMonitoringProbe, connect, connect, connect, connect, getMonitoringProbes, getProcessor, getProcessorSelector, 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()
throws java.io.IOException
- Creates non-connected UDP
Connection.
- Returns:
- non-connected UDP
Connection.
- Throws:
java.io.IOException
connect
public GrizzlyFuture<Connection> connect(java.net.SocketAddress remoteAddress,
java.net.SocketAddress localAddress,
CompletionHandler<Connection> completionHandler)
throws java.io.IOException
- 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<java.net.SocketAddress>- Specified by:
connect in class AbstractSocketConnectorHandler
- Parameters:
remoteAddress - remote address to connect to.localAddress - local address to bind socket to.completionHandler - CompletionHandler.
- Returns:
Future of connect operation, which could be used to get
resulting Connection.
- Throws:
java.io.IOException
connectSync
protected GrizzlyFuture<Connection> connectSync(java.net.SocketAddress remoteAddress,
java.net.SocketAddress localAddress,
CompletionHandler<Connection> completionHandler)
throws java.io.IOException
- Throws:
java.io.IOException
connectAsync
protected GrizzlyFuture<Connection> connectAsync(java.net.SocketAddress remoteAddress,
java.net.SocketAddress localAddress,
CompletionHandler<Connection> completionHandler)
throws java.io.IOException
- Throws:
java.io.IOException
isReuseAddress
public boolean isReuseAddress()
setReuseAddress
public void setReuseAddress(boolean isReuseAddress)
getSyncConnectTimeout
public long getSyncConnectTimeout(java.util.concurrent.TimeUnit timeUnit)
setSyncConnectTimeout
public void setSyncConnectTimeout(long timeout,
java.util.concurrent.TimeUnit timeUnit)
waitNIOFuture
protected <E> E waitNIOFuture(java.util.concurrent.Future<E> future)
throws java.io.IOException
- Throws:
java.io.IOException
builder
public static UDPNIOConnectorHandler.Builder builder(UDPNIOTransport transport)
- Return the
UDPNIOConnectorHandler builder.
- Parameters:
transport - UDPNIOTransport.
- Returns:
- the
UDPNIOConnectorHandler builder.
Copyright © 2011 Oracle Corpration. All Rights Reserved.