Class NetClient
- All Implemented Interfaces:
io.vertx.lang.rx.RxDelegate, Measured
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 the original non RX-ified interface using Vert.x codegen.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionclose()Close immediately (shutdown(0, TimeUnit.SECONDS).Open a connection to a server at the specificportandhost.Open a connection to a server at the specificportandhost.connect(ConnectOptions connectOptions) Open a connection to a server at the specificconnectOptions.connect(SocketAddress remoteAddress) Open a connection to a server at the specificremoteAddress.connect(SocketAddress remoteAddress, String serverName) Open a connection to a server at the specificremoteAddress.booleaninthashCode()booleanWhether the metrics are enabled for this measured objectstatic NetClientnewInstance(NetClient arg) rxClose()Close immediately (shutdown(0, TimeUnit.SECONDS).Open a connection to a server at the specificportandhost.Open a connection to a server at the specificportandhost.rxConnect(ConnectOptions connectOptions) Open a connection to a server at the specificconnectOptions.rxConnect(SocketAddress remoteAddress) Open a connection to a server at the specificremoteAddress.rxConnect(SocketAddress remoteAddress, String serverName) Open a connection to a server at the specificremoteAddress.Shutdown with a 30 seconds timeout (shutdown(30, TimeUnit.SECONDS)).rxShutdown(long timeout, TimeUnit unit) Callsshutdown().rxShutdown(Duration timeout) Initiate the client shutdown sequence.rxUpdateSSLOptions(ClientSSLOptions options) Update the client with new SSLoptions, the update happens if the options object is valid and different from the existing options object.rxUpdateSSLOptions(ClientSSLOptions options, boolean force) Update the client with new SSLoptions, the update happens if the options object is valid and different from the existing options object.shutdown()Shutdown with a 30 seconds timeout (shutdown(30, TimeUnit.SECONDS)).Callsshutdown().Initiate the client shutdown sequence.toString()updateSSLOptions(ClientSSLOptions options) Update the client with new SSLoptions, the update happens if the options object is valid and different from the existing options object.updateSSLOptions(ClientSSLOptions options, boolean force) Update the client with new SSLoptions, the update happens if the options object is valid and different from the existing options object.
-
Field Details
-
__TYPE_ARG
-
-
Constructor Details
-
NetClient
-
NetClient
-
-
Method Details
-
toString
-
equals
-
hashCode
-
getDelegate
- Specified by:
getDelegatein interfaceMeasured- Specified by:
getDelegatein interfaceio.vertx.lang.rx.RxDelegate
-
isMetricsEnabled
public boolean isMetricsEnabled()Whether the metrics are enabled for this measured object- Specified by:
isMetricsEnabledin interfaceMeasured- Returns:
trueif metrics are enabled
-
connect
-
rxConnect
-
connect
Open a connection to a server at the specificportandhost.hostcan be a valid host name or IP address.- Parameters:
port- the porthost- the hostserverName- the SNI server name- Returns:
- a future notified when the socket is connected
-
rxConnect
Open a connection to a server at the specificportandhost.hostcan be a valid host name or IP address.- Parameters:
port- the porthost- the hostserverName- the SNI server name- Returns:
- a future notified when the socket is connected
-
connect
Open a connection to a server at the specificremoteAddress.- Parameters:
remoteAddress- the remote address- Returns:
- a future notified when the socket is connected
-
rxConnect
Open a connection to a server at the specificremoteAddress.- Parameters:
remoteAddress- the remote address- Returns:
- a future notified when the socket is connected
-
connect
Open a connection to a server at the specificremoteAddress.- Parameters:
remoteAddress- the remote addressserverName- the SNI server name- Returns:
- a future notified when the socket is connected
-
rxConnect
Open a connection to a server at the specificremoteAddress.- Parameters:
remoteAddress- the remote addressserverName- the SNI server name- Returns:
- a future notified when the socket is connected
-
connect
Open a connection to a server at the specificconnectOptions.- Parameters:
connectOptions- the options describing how to connect to the remote server- Returns:
- a future notified when the socket is connected
-
rxConnect
Open a connection to a server at the specificconnectOptions.- Parameters:
connectOptions- the options describing how to connect to the remote server- Returns:
- a future notified when the socket is connected
-
close
Close immediately (shutdown(0, TimeUnit.SECONDS).- Returns:
- a future notified when the client is closed
-
rxClose
Close immediately (shutdown(0, TimeUnit.SECONDS).- Returns:
- a future notified when the client is closed
-
shutdown
Shutdown with a 30 seconds timeout (shutdown(30, TimeUnit.SECONDS)).- Returns:
- a future completed when shutdown has completed
-
rxShutdown
Shutdown with a 30 seconds timeout (shutdown(30, TimeUnit.SECONDS)).- Returns:
- a future completed when shutdown has completed
-
shutdown
Callsshutdown().- Parameters:
timeout-unit-- Returns:
-
rxShutdown
Callsshutdown().- Parameters:
timeout-unit-- Returns:
-
updateSSLOptions
Update the client with new SSL
options, the update happens if the options object is valid and different from the existing options object.The boolean succeeded future result indicates whether the update occurred.
- Parameters:
options- the new SSL options- Returns:
- a future signaling the update success
-
rxUpdateSSLOptions
Update the client with new SSL
options, the update happens if the options object is valid and different from the existing options object.The boolean succeeded future result indicates whether the update occurred.
- Parameters:
options- the new SSL options- Returns:
- a future signaling the update success
-
updateSSLOptions
Update the client with new SSL
options, the update happens if the options object is valid and different from the existing options object.The
optionsobject is compared using itsequalsmethod against the existing options to prevent an update when the objects are equals since loading options can be costly, this can happen for share TCP servers. When object are equals, settingforcetotrueforces the update.The boolean succeeded future result indicates whether the update occurred.
- Parameters:
options- the new SSL optionsforce- force the update when options are equals- Returns:
- a future signaling the update success
-
rxUpdateSSLOptions
Update the client with new SSL
options, the update happens if the options object is valid and different from the existing options object.The
optionsobject is compared using itsequalsmethod against the existing options to prevent an update when the objects are equals since loading options can be costly, this can happen for share TCP servers. When object are equals, settingforcetotrueforces the update.The boolean succeeded future result indicates whether the update occurred.
- Parameters:
options- the new SSL optionsforce- force the update when options are equals- Returns:
- a future signaling the update success
-
shutdown
Initiate the client shutdown sequence.Connections are taken out of service and notified the close sequence has started through
NetSocket.shutdownHandler(Handler). When all connections are closed the client is closed. When thetimeoutexpires, all unclosed connections are immediately closed.- Parameters:
timeout- the amount of time after which all resources are forcibly closed- Returns:
- a future notified when the client is closed
-
rxShutdown
Initiate the client shutdown sequence.Connections are taken out of service and notified the close sequence has started through
NetSocket.shutdownHandler(Handler). When all connections are closed the client is closed. When thetimeoutexpires, all unclosed connections are immediately closed.- Parameters:
timeout- the amount of time after which all resources are forcibly closed- Returns:
- a future notified when the client is closed
-
newInstance
-