public class NetClientImpl extends Object implements MetricsProvider, NetClient, Closeable
| Modifier and Type | Field and Description |
|---|---|
protected int |
idleTimeout |
protected boolean |
logEnabled |
| Constructor and Description |
|---|
NetClientImpl(VertxInternal vertx,
io.netty.channel.group.ChannelGroup channelGroup,
SSLHelper sslHelper,
NetClientOptions options) |
NetClientImpl(VertxInternal vertx,
NetClientOptions options,
CloseFuture closeFuture) |
| Modifier and Type | Method and Description |
|---|---|
Future<Void> |
close()
Like
NetClient.close(Handler) but returns a Future of the asynchronous result |
void |
close(Handler<AsyncResult<Void>> handler)
Close the client.
|
void |
close(Promise<Void> completion)
Close this resource, the
completion promise must be notified when the operation has completed. |
Future<NetSocket> |
connect(ContextInternal context,
SocketAddress remoteAddress,
String serverName) |
Future<NetSocket> |
connect(int port,
String host)
Like
NetClient.connect(int, String, Handler) but returns a Future of the asynchronous result |
NetClient |
connect(int port,
String host,
Handler<AsyncResult<NetSocket>> connectHandler)
Open a connection to a server at the specific
port and host. |
Future<NetSocket> |
connect(int port,
String host,
String serverName)
Like
NetClient.connect(int, String, String, Handler) but returns a Future of the asynchronous result |
NetClient |
connect(int port,
String host,
String serverName,
Handler<AsyncResult<NetSocket>> connectHandler)
Open a connection to a server at the specific
port and host. |
Future<NetSocket> |
connect(SocketAddress remoteAddress)
Like
NetClient.connect(SocketAddress, Handler) but returns a Future of the asynchronous result |
NetClient |
connect(SocketAddress remoteAddress,
Handler<AsyncResult<NetSocket>> connectHandler)
Open a connection to a server at the specific
remoteAddress. |
Future<NetSocket> |
connect(SocketAddress remoteAddress,
String serverName)
Like
NetClient.connect(SocketAddress, String, Handler) but returns a Future of the asynchronous result |
NetClient |
connect(SocketAddress remoteAddress,
String serverName,
Handler<AsyncResult<NetSocket>> connectHandler)
Open a connection to a server at the specific
remoteAddress. |
void |
doConnect(SocketAddress remoteAddress,
SocketAddress peerAddress,
String serverName,
Promise<NetSocket> connectHandler,
ContextInternal context,
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
public NetClientImpl(VertxInternal vertx, io.netty.channel.group.ChannelGroup channelGroup, SSLHelper sslHelper, NetClientOptions options)
public NetClientImpl(VertxInternal vertx, NetClientOptions options, CloseFuture closeFuture)
protected void initChannel(io.netty.channel.ChannelPipeline pipeline)
public Future<NetSocket> connect(int port, String host)
NetClientNetClient.connect(int, String, Handler) but returns a Future of the asynchronous resultpublic Future<NetSocket> connect(int port, String host, String serverName)
NetClientNetClient.connect(int, String, String, Handler) but returns a Future of the asynchronous resultpublic Future<NetSocket> connect(SocketAddress remoteAddress)
NetClientNetClient.connect(SocketAddress, Handler) but returns a Future of the asynchronous resultpublic Future<NetSocket> connect(SocketAddress remoteAddress, String serverName)
NetClientNetClient.connect(SocketAddress, String, Handler) but returns a Future of the asynchronous resultpublic Future<NetSocket> connect(ContextInternal context, SocketAddress remoteAddress, String serverName)
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(Handler<AsyncResult<Void>> handler)
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 Future<Void> close()
NetClientNetClient.close(Handler) but returns a Future of the asynchronous resultpublic void close(Promise<Void> completion)
Closeablecompletion promise must be notified when the operation has completed.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
public void doConnect(SocketAddress remoteAddress, SocketAddress peerAddress, String serverName, Promise<NetSocket> connectHandler, ContextInternal context, int remainingAttempts)
Copyright © 2021. All rights reserved.