public class TCPNIOConnectorHandler extends AbstractSocketConnectorHandler
Modifier and Type | Class and Description |
---|---|
static class |
TCPNIOConnectorHandler.Builder |
Modifier and Type | Field and Description |
---|---|
protected long |
connectionTimeoutMillis |
protected static int |
DEFAULT_CONNECTION_TIMEOUT |
protected boolean |
isReuseAddress |
probes, transport
Modifier | Constructor and Description |
---|---|
protected |
TCPNIOConnectorHandler(TCPNIOTransport transport) |
Modifier and Type | Method and Description |
---|---|
static TCPNIOConnectorHandler.Builder |
builder(TCPNIOTransport transport)
Return the
TCPNIOConnectorHandler builder. |
void |
connect(SocketAddress remoteAddress,
SocketAddress localAddress,
CompletionHandler<Connection> completionHandler)
Creates, initializes
Connection , binds it to the specific local
and remote remoteAddress . |
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() |
protected static void |
onConnectedAsync(TCPNIOConnection connection,
CompletionHandler<Connection> completionHandler) |
void |
setReuseAddress(boolean isReuseAddress) |
void |
setSyncConnectTimeout(long timeout,
TimeUnit timeUnit) |
protected void |
waitNIOFuture(FutureImpl<Connection> future,
CompletionHandler<Connection> completionHandler) |
addMonitoringProbe, connect, connect, connect, connect, getMonitoringProbes, getProcessor, getProcessorSelector, makeCancellableFuture, preConfigure, removeMonitoringProbe, setProcessor, setProcessorSelector
protected static final int DEFAULT_CONNECTION_TIMEOUT
protected boolean isReuseAddress
protected volatile long connectionTimeoutMillis
protected TCPNIOConnectorHandler(TCPNIOTransport transport)
public void connect(SocketAddress remoteAddress, SocketAddress localAddress, CompletionHandler<Connection> completionHandler)
ConnectorHandler
Connection
, binds it to the specific local
and remote remoteAddress
.connect
in interface ConnectorHandler<SocketAddress>
connect
in class AbstractSocketConnectorHandler
remoteAddress
- remote address to connect tolocalAddress
- local address to bind a Connection
tocompletionHandler
- CompletionHandler
protected void connectSync(SocketAddress remoteAddress, SocketAddress localAddress, CompletionHandler<Connection> completionHandler)
protected FutureImpl<Connection> connectAsync(SocketAddress remoteAddress, SocketAddress localAddress, CompletionHandler<Connection> completionHandler, boolean needFuture)
connectAsync
in class AbstractSocketConnectorHandler
protected static void onConnectedAsync(TCPNIOConnection connection, CompletionHandler<Connection> completionHandler) throws IOException
IOException
public boolean isReuseAddress()
public void setReuseAddress(boolean isReuseAddress)
public long getSyncConnectTimeout(TimeUnit timeUnit)
public void setSyncConnectTimeout(long timeout, TimeUnit timeUnit)
protected void waitNIOFuture(FutureImpl<Connection> future, CompletionHandler<Connection> completionHandler)
public static TCPNIOConnectorHandler.Builder builder(TCPNIOTransport transport)
TCPNIOConnectorHandler
builder.transport
- TCPNIOTransport
.TCPNIOConnectorHandler
builder.Copyright © 2015 Oracle Corporation. All rights reserved.