public class NetClientImpl extends Object implements MetricsProvider, NetClient
| Modifier and Type | Field and Description |
|---|---|
protected int |
idleTimeout |
protected boolean |
logEnabled |
protected SSLHelper |
sslHelper |
| Constructor and Description |
|---|
NetClientImpl(VertxInternal vertx,
NetClientOptions options) |
NetClientImpl(VertxInternal vertx,
NetClientOptions options,
boolean useCreatingContext) |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Close the client.
|
NetClient |
connect(int port,
String host,
Handler<AsyncResult<NetSocket>> connectHandler)
Open a connection to a server at the specific
port and host. |
NetClient |
connect(int port,
String host,
String serverName,
Handler<AsyncResult<NetSocket>> connectHandler)
Open a connection to a server at the specific
port and host. |
NetClient |
connect(SocketAddress remoteAddress,
Handler<AsyncResult<NetSocket>> connectHandler)
Open a connection to a server at the specific
remoteAddress. |
NetClient |
connect(SocketAddress remoteAddress,
String serverName,
Handler<AsyncResult<NetSocket>> connectHandler)
Open a connection to a server at the specific
remoteAddress. |
protected void |
doConnect(SocketAddress remoteAddress,
String serverName,
Handler<AsyncResult<NetSocket>> connectHandler) |
protected void |
doConnect(SocketAddress remoteAddress,
String serverName,
Handler<AsyncResult<NetSocket>> connectHandler,
int remainingAttempts) |
protected void |
finalize() |
Metrics |
getMetrics()
Returns the metrics implementation.
|
protected void |
initChannel(io.netty.channel.ChannelPipeline pipeline) |
boolean |
isMetricsEnabled()
Whether the metrics are enabled for this measured object
|
protected final int idleTimeout
protected final boolean logEnabled
protected final SSLHelper sslHelper
public NetClientImpl(VertxInternal vertx, NetClientOptions options)
public NetClientImpl(VertxInternal vertx, NetClientOptions options, boolean useCreatingContext)
protected void initChannel(io.netty.channel.ChannelPipeline pipeline)
public NetClient connect(int port, String host, Handler<AsyncResult<NetSocket>> connectHandler)
NetClientport and host.
host can be a valid host name or IP address. The connect is done asynchronously and on success, a
NetSocket instance is supplied via the connectHandler instance
public NetClient connect(int port, String host, String serverName, Handler<AsyncResult<NetSocket>> connectHandler)
NetClientport and host.
host can be a valid host name or IP address. The connect is done asynchronously and on success, a
NetSocket instance is supplied via the connectHandler instance
public void close()
NetClientAny sockets which have not been closed manually will be closed here. The close is asynchronous and may not complete until some time after the method has returned.
public boolean isMetricsEnabled()
MeasuredisMetricsEnabled in interface Measuredtrue if metrics are enabledpublic Metrics getMetrics()
MetricsProvidergetMetrics in interface MetricsProviderpublic NetClient connect(SocketAddress remoteAddress, String serverName, Handler<AsyncResult<NetSocket>> connectHandler)
NetClientremoteAddress.
The connect is done asynchronously and on success, a NetSocket instance is supplied via the connectHandler instance
public NetClient connect(SocketAddress remoteAddress, Handler<AsyncResult<NetSocket>> connectHandler)
NetClientremoteAddress.
The connect is done asynchronously and on success, a NetSocket instance is supplied via the connectHandler instance
protected void doConnect(SocketAddress remoteAddress, String serverName, Handler<AsyncResult<NetSocket>> connectHandler)
protected void doConnect(SocketAddress remoteAddress, String serverName, Handler<AsyncResult<NetSocket>> connectHandler, int remainingAttempts)
Copyright © 2020. All rights reserved.