- All Superinterfaces:
Measured
An asynchronous WebSocket client.
It allows you to open WebSockets to servers.
- Author:
- Tim Fox
-
Method Summary
Modifier and TypeMethodDescriptionclose()Close immediately (shutdown(0, TimeUnit.SECONDS).Connect a WebSocket to the specified port, host and relative request URI.connect(WebSocketConnectOptions options) Connect a WebSocket with the specified options.Connect a WebSocket to the default client port, default client host and specified, relative request URI.Connect a WebSocket to the default client port and specified host and relative request URI.shutdown()Shutdown with a 30 seconds timeout (shutdown(30, TimeUnit.SECONDS)).Callsshutdown(Duration).Initiate the client shutdown sequence.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.Create a WebSocket that is not yet connected to the server.Methods inherited from interface io.vertx.core.metrics.Measured
isMetricsEnabled
-
Method Details
-
webSocket
ClientWebSocket webSocket()Create a WebSocket that is not yet connected to the server.- Returns:
- the client WebSocket
-
connect
Connect a WebSocket to the specified port, host and relative request URI.- Parameters:
port- the porthost- the hostrequestURI- the relative URI- Returns:
- a future notified when the WebSocket when connected
-
connect
Connect a WebSocket to the default client port and specified host and relative request URI.- Parameters:
host- the hostrequestURI- the relative URI- Returns:
- a future notified when the WebSocket when connected
-
connect
Connect a WebSocket to the default client port, default client host and specified, relative request URI.- Parameters:
requestURI- the relative URI- Returns:
- a future notified when the WebSocket when connected
-
connect
Connect a WebSocket with the specified options.- Parameters:
options- the request options- Returns:
- a future notified when the WebSocket when connected
-
shutdown
Shutdown with a 30 seconds timeout (shutdown(30, TimeUnit.SECONDS)).- Returns:
- a future completed when shutdown has completed
-
close
Close immediately (shutdown(0, TimeUnit.SECONDS).- Returns:
- a future notified when the client is closed
-
updateSSLOptions
Update the client with new SSLoptions, the update happens if the options object is valid and different from the existing options object.- 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.- Parameters:
options- the new SSL optionsforce- force the update when options are equals- Returns:
- a future signaling the update success
-
shutdown
Callsshutdown(Duration). -
shutdown
Initiate the client shutdown sequence.- Parameters:
timeout- the amount of time after which all resources are forcibly closed- Returns:
- a future notified when the client is closed
-