Package io.vertx.reactivex.core.http

## Class WebSocketClient

- java.lang.Object
- - io.vertx.reactivex.core.http.WebSocketClient

- All Implemented Interfaces:
    `io.vertx.lang.rx.RxDelegate`, `Measured`

      public class WebSocketClient
      extends Object
      implements io.vertx.lang.rx.RxDelegate, Measured

  An asynchronous WebSocket client.

  It allows you to open WebSockets to servers.

  NOTE: This class has been automatically generated from the `original` non RX-ified interface using Vert.x codegen.

- - ### Field Summary

    Fields
    Modifier and Type | Field | Description
    --- | --- | ---
    `static io.vertx.lang.rx.TypeArg<WebSocketClient>` | `__TYPE_ARG` |

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `WebSocketClient​(WebSocketClient delegate)` |
    `WebSocketClient​(Object delegate)` |

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `Future<Void>` | `close()` | Close immediately (`shutdown(0, TimeUnit.SECONDS`).
    `Future<WebSocket>` | `connect​(int port, String host, String requestURI)` | Connect a WebSocket to the specified port, host and relative request URI.
    `Future<WebSocket>` | `connect​(WebSocketConnectOptions options)` | Connect a WebSocket with the specified options.
    `Future<WebSocket>` | `connect​(String requestURI)` | Connect a WebSocket to the default client port, default client host and specified, relative request URI.
    `Future<WebSocket>` | `connect​(String host, String requestURI)` | Connect a WebSocket to the default client port and specified host and relative request URI.
    `boolean` | `equals​(Object o)` |
    `WebSocketClient` | `getDelegate()` |
    `int` | `hashCode()` |
    `boolean` | `isMetricsEnabled()` | Whether the metrics are enabled for this measured object
    `static WebSocketClient` | `newInstance​(WebSocketClient arg)` |
    `Completable` | `rxClose()` | Close immediately (`shutdown(0, TimeUnit.SECONDS`).
    `Single<WebSocket>` | `rxConnect​(int port, String host, String requestURI)` | Connect a WebSocket to the specified port, host and relative request URI.
    `Single<WebSocket>` | `rxConnect​(WebSocketConnectOptions options)` | Connect a WebSocket with the specified options.
    `Single<WebSocket>` | `rxConnect​(String requestURI)` | Connect a WebSocket to the default client port, default client host and specified, relative request URI.
    `Single<WebSocket>` | `rxConnect​(String host, String requestURI)` | Connect a WebSocket to the default client port and specified host and relative request URI.
    `Completable` | `rxShutdown()` | Shutdown with a 30 seconds timeout (`shutdown(30, TimeUnit.SECONDS)`).
    `Completable` | `rxShutdown​(long timeout, TimeUnit unit)` | Initiate the client shutdown sequence.
    `Single<Boolean>` | `rxUpdateSSLOptions​(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.
    `Single<Boolean>` | `rxUpdateSSLOptions​(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.
    `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.
    `String` | `toString()` |
    `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.
    `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.
    `ClientWebSocket` | `webSocket()` | Create a WebSocket that is not yet connected to the server.

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- - ### Field Detail

    - #### __TYPE_ARG

          public static final io.vertx.lang.rx.TypeArg<WebSocketClient> __TYPE_ARG

  - ### Constructor Detail

    - #### WebSocketClient

          public WebSocketClient​(WebSocketClient delegate)

    - #### WebSocketClient

          public WebSocketClient​(Object delegate)

  - ### Method Detail

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

    - #### equals

          public boolean equals​(Object o)

      Overrides:
        `equals` in class `Object`

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `Object`

    - #### getDelegate

          public WebSocketClient getDelegate()

      Specified by:
        `getDelegate` in interface `Measured`
      Specified by:
        `getDelegate` in interface `io.vertx.lang.rx.RxDelegate`

    - #### isMetricsEnabled

          public boolean isMetricsEnabled()

      Whether the metrics are enabled for this measured object
      Specified by:
        `isMetricsEnabled` in interface `Measured`
      Returns:
        `true` if metrics are enabled

    - #### webSocket

          public ClientWebSocket webSocket()

      Create a WebSocket that is not yet connected to the server.
      Returns:
        the client WebSocket

    - #### connect

          public Future<WebSocket> connect​(int port,
                                           String host,
                                           String requestURI)

      Connect a WebSocket to the specified port, host and relative request URI.
      Parameters:
        `port` - the port
        `host` - the host
        `requestURI` - the relative URI
      Returns:
        a future notified when the WebSocket when connected

    - #### rxConnect

          public Single<WebSocket> rxConnect​(int port,
                                             String host,
                                             String requestURI)

      Connect a WebSocket to the specified port, host and relative request URI.
      Parameters:
        `port` - the port
        `host` - the host
        `requestURI` - the relative URI
      Returns:
        a future notified when the WebSocket when connected

    - #### connect

          public Future<WebSocket> connect​(String host,
                                           String requestURI)

      Connect a WebSocket to the default client port and specified host and relative request URI.
      Parameters:
        `host` - the host
        `requestURI` - the relative URI
      Returns:
        a future notified when the WebSocket when connected

    - #### rxConnect

          public Single<WebSocket> rxConnect​(String host,
                                             String requestURI)

      Connect a WebSocket to the default client port and specified host and relative request URI.
      Parameters:
        `host` - the host
        `requestURI` - the relative URI
      Returns:
        a future notified when the WebSocket when connected

    - #### connect

          public Future<WebSocket> connect​(String requestURI)

      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

    - #### rxConnect

          public Single<WebSocket> rxConnect​(String requestURI)

      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

          public Future<WebSocket> connect​(WebSocketConnectOptions options)

      Connect a WebSocket with the specified options.
      Parameters:
        `options` - the request options
      Returns:
        a future notified when the WebSocket when connected

    - #### rxConnect

          public Single<WebSocket> rxConnect​(WebSocketConnectOptions options)

      Connect a WebSocket with the specified options.
      Parameters:
        `options` - the request options
      Returns:
        a future notified when the WebSocket when connected

    - #### shutdown

          public Future<Void> shutdown()

      Shutdown with a 30 seconds timeout (`shutdown(30, TimeUnit.SECONDS)`).
      Returns:
        a future completed when shutdown has completed

    - #### rxShutdown

          public Completable rxShutdown()

      Shutdown with a 30 seconds timeout (`shutdown(30, TimeUnit.SECONDS)`).
      Returns:
        a future completed when shutdown has completed

    - #### close

          public Future<Void> close()

      Close immediately (`shutdown(0, TimeUnit.SECONDS`).
      Returns:
        a future notified when the client is closed

    - #### rxClose

          public Completable rxClose()

      Close immediately (`shutdown(0, TimeUnit.SECONDS`).
      Returns:
        a future notified when the client is closed

    - #### updateSSLOptions

          public 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.
      Parameters:
        `options` - the new SSL options
      Returns:
        a future signaling the update success

    - #### rxUpdateSSLOptions

          public Single<Boolean> rxUpdateSSLOptions​(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.
      Parameters:
        `options` - the new SSL options
      Returns:
        a future signaling the update success

    - #### updateSSLOptions

          public 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 its `equals` 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, setting `force` to `true` forces the update.

      Parameters:
        `options` - the new SSL options
        `force` - force the update when options are equals
      Returns:
        a future signaling the update success

    - #### rxUpdateSSLOptions

          public Single<Boolean> rxUpdateSSLOptions​(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 its `equals` 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, setting `force` to `true` forces the update.

      Parameters:
        `options` - the new SSL options
        `force` - force the update when options are equals
      Returns:
        a future signaling the update success

    - #### shutdown

          public Future<Void> shutdown​(long timeout,
                                       TimeUnit unit)

      Initiate the client shutdown sequence.
      Parameters:
        `timeout` - the amount of time after which all resources are forcibly closed
        `unit` - the of the timeout
      Returns:
        a future notified when the client is closed

    - #### rxShutdown

          public Completable rxShutdown​(long timeout,
                                        TimeUnit unit)

      Initiate the client shutdown sequence.
      Parameters:
        `timeout` - the amount of time after which all resources are forcibly closed
        `unit` - the of the timeout
      Returns:
        a future notified when the client is closed

    - #### newInstance

          public static WebSocketClient newInstance​(WebSocketClient arg)