Interface NetClient
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default Future<Void>
close()
Close immediately (shutdown(0, TimeUnit.SECONDS
).Future<NetSocket>
connect(int port, String host)
Open a connection to a server at the specificport
andhost
.Future<NetSocket>
connect(int port, String host, String serverName)
Open a connection to a server at the specificport
andhost
.Future<NetSocket>
connect(ConnectOptions connectOptions)
Open a connection to a server at the specificconnectOptions
.Future<NetSocket>
connect(SocketAddress remoteAddress)
Open a connection to a server at the specificremoteAddress
.Future<NetSocket>
connect(SocketAddress remoteAddress, String serverName)
Open a connection to a server at the specificremoteAddress
.default Future<Void>
shutdown()
Shutdown with a 30 seconds timeout (shutdown(30, TimeUnit.SECONDS)
).Future<Void>
shutdown(long timeout, TimeUnit unit)
Initiate the client shutdown sequence.default Future<Boolean>
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.Future<Boolean>
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.-
Methods inherited from interface io.vertx.core.metrics.Measured
isMetricsEnabled
-
-
-
-
Method Detail
-
connect
Future<NetSocket> connect(int port, String host)
Open a connection to a server at the specificport
andhost
.host
can be a valid host name or IP address. The connect is done asynchronously and on success, aNetSocket
instance is supplied via theconnectHandler
instance- Parameters:
port
- the porthost
- the host- Returns:
- a future notified when the socket is connected
-
connect
Future<NetSocket> connect(int port, String host, String serverName)
Open a connection to a server at the specificport
andhost
.host
can be a valid host name or IP address. The connect is done asynchronously and on success, aNetSocket
instance is supplied via theconnectHandler
instance- Parameters:
port
- the porthost
- the hostserverName
- the SNI server name- Returns:
- a future notified when the socket is connected
-
connect
Future<NetSocket> connect(SocketAddress remoteAddress)
Open a connection to a server at the specificremoteAddress
.The connect is done asynchronously and on success, a
NetSocket
instance is supplied via theconnectHandler
instance- Parameters:
remoteAddress
- the remote address- Returns:
- a future notified when the socket is connected
-
connect
Future<NetSocket> connect(SocketAddress remoteAddress, String serverName)
Open a connection to a server at the specificremoteAddress
.The connect is done asynchronously and on success, a
NetSocket
instance is supplied via theconnectHandler
instance- Parameters:
remoteAddress
- the remote addressserverName
- the SNI server name- Returns:
- a future notified when the socket is connected
-
connect
Future<NetSocket> connect(ConnectOptions connectOptions)
Open a connection to a server at the specificconnectOptions
.The connect is done asynchronously and on success, a
NetSocket
instance is supplied via theconnectHandler
instance- Parameters:
connectOptions
- the options describing how to connect to the remote server- Returns:
- a future notified when the socket is connected
-
close
default Future<Void> close()
Close immediately (shutdown(0, TimeUnit.SECONDS
).- Returns:
- a future notified when the client is closed
-
shutdown
default Future<Void> shutdown()
Shutdown with a 30 seconds timeout (shutdown(30, TimeUnit.SECONDS)
).- Returns:
- a future completed when shutdown has completed
-
shutdown
Future<Void> shutdown(long timeout, TimeUnit unit)
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 thetimeout
expires, all unclosed connections are immediately closed.- Parameters:
timeout
- the amount of time after which all resources are forcibly closedunit
- the of the timeout- Returns:
- a future notified when the client is closed
-
updateSSLOptions
default Future<Boolean> updateSSLOptions(ClientSSLOptions options)
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
Future<Boolean> updateSSLOptions(ClientSSLOptions options, boolean force)
Update the client with new SSL
options
, the update happens if the options object is valid and different from the existing options object.The
options
object is compared using itsequals
method 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, settingforce
totrue
forces 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
-
-