Class NetClient
- java.lang.Object
-
- io.vertx.reactivex.core.net.NetClient
-
- All Implemented Interfaces:
Measured
public class NetClient extends Object implements Measured
A TCP client.Multiple connections to different servers can be made using the same instance.
This client supports a configurable number of connection attempts and a configurable delay between attempts.
NOTE: This class has been automatically generated from theoriginalnon RX-ified interface using Vert.x codegen.
-
-
Field Summary
Fields Modifier and Type Field Description static TypeArg<NetClient>__TYPE_ARG
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Close the client.voidclose(Handler<AsyncResult<Void>> handler)Close the client.NetClientconnect(int port, String host)Open a connection to a server at the specificportandhost.NetClientconnect(int port, String host, Handler<AsyncResult<NetSocket>> connectHandler)Open a connection to a server at the specificportandhost.NetClientconnect(int port, String host, String serverName)Open a connection to a server at the specificportandhost.NetClientconnect(int port, String host, String serverName, Handler<AsyncResult<NetSocket>> connectHandler)Open a connection to a server at the specificportandhost.NetClientconnect(SocketAddress remoteAddress)Open a connection to a server at the specificremoteAddress.NetClientconnect(SocketAddress remoteAddress, Handler<AsyncResult<NetSocket>> connectHandler)Open a connection to a server at the specificremoteAddress.NetClientconnect(SocketAddress remoteAddress, String serverName)Open a connection to a server at the specificremoteAddress.NetClientconnect(SocketAddress remoteAddress, String serverName, Handler<AsyncResult<NetSocket>> connectHandler)Open a connection to a server at the specificremoteAddress.booleanequals(Object o)NetClientgetDelegate()inthashCode()booleanisMetricsEnabled()Whether the metrics are enabled for this measured objectstatic NetClientnewInstance(NetClient arg)io.reactivex.CompletablerxClose()Close the client.io.reactivex.Single<NetSocket>rxConnect(int port, String host)Open a connection to a server at the specificportandhost.io.reactivex.Single<NetSocket>rxConnect(int port, String host, String serverName)Open a connection to a server at the specificportandhost.io.reactivex.Single<NetSocket>rxConnect(SocketAddress remoteAddress)Open a connection to a server at the specificremoteAddress.io.reactivex.Single<NetSocket>rxConnect(SocketAddress remoteAddress, String serverName)Open a connection to a server at the specificremoteAddress.io.reactivex.CompletablerxUpdateSSLOptions(SSLOptions options)LikeupdateSSLOptions(io.vertx.core.net.SSLOptions, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>>)but supplying a handler that will be called when the update happened (or has failed).StringtoString()voidupdateSSLOptions(SSLOptions options)LikeupdateSSLOptions(io.vertx.core.net.SSLOptions, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>>)but supplying a handler that will be called when the update happened (or has failed).voidupdateSSLOptions(SSLOptions options, Handler<AsyncResult<Void>> handler)LikeupdateSSLOptions(io.vertx.core.net.SSLOptions, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>>)but supplying a handler that will be called when the update happened (or has failed).
-
-
-
Method Detail
-
getDelegate
public NetClient getDelegate()
- Specified by:
getDelegatein interfaceMeasured
-
isMetricsEnabled
public boolean isMetricsEnabled()
Whether the metrics are enabled for this measured object- Specified by:
isMetricsEnabledin interfaceMeasured- Returns:
trueif metrics are enabled
-
connect
public NetClient connect(int port, String host, Handler<AsyncResult<NetSocket>> connectHandler)
Open a connection to a server at the specificportandhost.hostcan be a valid host name or IP address. The connect is done asynchronously and on success, aNetSocketinstance is supplied via theconnectHandlerinstance- Parameters:
port- the porthost- the hostconnectHandler-- Returns:
- a reference to this, so the API can be used fluently
-
connect
public NetClient connect(int port, String host)
Open a connection to a server at the specificportandhost.hostcan be a valid host name or IP address. The connect is done asynchronously and on success, aNetSocketinstance is supplied via theconnectHandlerinstance- Parameters:
port- the porthost- the host- Returns:
- a reference to this, so the API can be used fluently
-
rxConnect
public io.reactivex.Single<NetSocket> rxConnect(int port, String host)
Open a connection to a server at the specificportandhost.hostcan be a valid host name or IP address. The connect is done asynchronously and on success, aNetSocketinstance is supplied via theconnectHandlerinstance- Parameters:
port- the porthost- the host- Returns:
- a reference to this, so the API can be used fluently
-
connect
public NetClient connect(int port, String host, String serverName, Handler<AsyncResult<NetSocket>> connectHandler)
Open a connection to a server at the specificportandhost.hostcan be a valid host name or IP address. The connect is done asynchronously and on success, aNetSocketinstance is supplied via theconnectHandlerinstance- Parameters:
port- the porthost- the hostserverName- the SNI server nameconnectHandler-- Returns:
- a reference to this, so the API can be used fluently
-
connect
public NetClient connect(int port, String host, String serverName)
Open a connection to a server at the specificportandhost.hostcan be a valid host name or IP address. The connect is done asynchronously and on success, aNetSocketinstance is supplied via theconnectHandlerinstance- Parameters:
port- the porthost- the hostserverName- the SNI server name- Returns:
- a reference to this, so the API can be used fluently
-
rxConnect
public io.reactivex.Single<NetSocket> rxConnect(int port, String host, String serverName)
Open a connection to a server at the specificportandhost.hostcan be a valid host name or IP address. The connect is done asynchronously and on success, aNetSocketinstance is supplied via theconnectHandlerinstance- Parameters:
port- the porthost- the hostserverName- the SNI server name- Returns:
- a reference to this, so the API can be used fluently
-
connect
public NetClient connect(SocketAddress remoteAddress, Handler<AsyncResult<NetSocket>> connectHandler)
Open a connection to a server at the specificremoteAddress.The connect is done asynchronously and on success, a
NetSocketinstance is supplied via theconnectHandlerinstance- Parameters:
remoteAddress- the remote addressconnectHandler-- Returns:
- a reference to this, so the API can be used fluently
-
connect
public NetClient connect(SocketAddress remoteAddress)
Open a connection to a server at the specificremoteAddress.The connect is done asynchronously and on success, a
NetSocketinstance is supplied via theconnectHandlerinstance- Parameters:
remoteAddress- the remote address- Returns:
- a reference to this, so the API can be used fluently
-
rxConnect
public io.reactivex.Single<NetSocket> rxConnect(SocketAddress remoteAddress)
Open a connection to a server at the specificremoteAddress.The connect is done asynchronously and on success, a
NetSocketinstance is supplied via theconnectHandlerinstance- Parameters:
remoteAddress- the remote address- Returns:
- a reference to this, so the API can be used fluently
-
connect
public NetClient connect(SocketAddress remoteAddress, String serverName, Handler<AsyncResult<NetSocket>> connectHandler)
Open a connection to a server at the specificremoteAddress.The connect is done asynchronously and on success, a
NetSocketinstance is supplied via theconnectHandlerinstance- Parameters:
remoteAddress- the remote addressserverName- the SNI server nameconnectHandler-- Returns:
- a reference to this, so the API can be used fluently
-
connect
public NetClient connect(SocketAddress remoteAddress, String serverName)
Open a connection to a server at the specificremoteAddress.The connect is done asynchronously and on success, a
NetSocketinstance is supplied via theconnectHandlerinstance- Parameters:
remoteAddress- the remote addressserverName- the SNI server name- Returns:
- a reference to this, so the API can be used fluently
-
rxConnect
public io.reactivex.Single<NetSocket> rxConnect(SocketAddress remoteAddress, String serverName)
Open a connection to a server at the specificremoteAddress.The connect is done asynchronously and on success, a
NetSocketinstance is supplied via theconnectHandlerinstance- Parameters:
remoteAddress- the remote addressserverName- the SNI server name- Returns:
- a reference to this, so the API can be used fluently
-
close
public void close(Handler<AsyncResult<Void>> handler)
Close the client.Any 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.
- Parameters:
handler-
-
close
public void close()
Close the client.Any 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.
-
rxClose
public io.reactivex.Completable rxClose()
Close the client.Any 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.
- Returns:
-
updateSSLOptions
public void updateSSLOptions(SSLOptions options, Handler<AsyncResult<Void>> handler)
LikeupdateSSLOptions(io.vertx.core.net.SSLOptions, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>>)but supplying a handler that will be called when the update happened (or has failed).- Parameters:
options- the new SSL optionshandler- the update handler
-
updateSSLOptions
public void updateSSLOptions(SSLOptions options)
LikeupdateSSLOptions(io.vertx.core.net.SSLOptions, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>>)but supplying a handler that will be called when the update happened (or has failed).- Parameters:
options- the new SSL options
-
rxUpdateSSLOptions
public io.reactivex.Completable rxUpdateSSLOptions(SSLOptions options)
LikeupdateSSLOptions(io.vertx.core.net.SSLOptions, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>>)but supplying a handler that will be called when the update happened (or has failed).- Parameters:
options- the new SSL options- Returns:
-
-