Class WebSocketClient

  • All Implemented Interfaces:
    Measured

    public class WebSocketClient
    extends Object
    implements 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.

    • Constructor Detail

      • WebSocketClient

        public WebSocketClient​(io.vertx.core.http.WebSocketClient delegate)
      • WebSocketClient

        public WebSocketClient​(Object delegate)
    • Method Detail

      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object
      • getDelegate

        public io.vertx.core.http.WebSocketClient getDelegate()
        Specified by:
        getDelegate in interface Measured
      • 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 void connect​(int port,
                            String host,
                            String requestURI,
                            io.vertx.core.Handler<io.vertx.core.AsyncResult<WebSocket>> handler)
        Connect a WebSocket to the specified port, host and relative request URI
        Parameters:
        port - the port
        host - the host
        requestURI - the relative URI
        handler - handler that will be called with the WebSocket when connected
      • connect

        public void 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
      • rxConnect

        public rx.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:
      • connect

        public void connect​(String host,
                            String requestURI,
                            io.vertx.core.Handler<io.vertx.core.AsyncResult<WebSocket>> handler)
        Connect a WebSocket to the default client port and specified host and relative request URI.
        Parameters:
        host - the host
        requestURI - the relative URI
        handler - handler that will be called with the WebSocket when connected
      • connect

        public void 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
      • rxConnect

        public rx.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:
      • connect

        public void connect​(String requestURI,
                            io.vertx.core.Handler<io.vertx.core.AsyncResult<WebSocket>> handler)
        Connect a WebSocket to the default client port, default client host and specified, relative request URI.
        Parameters:
        requestURI - the relative URI
        handler - handler that will be called with the WebSocket when connected
      • connect

        public void connect​(String requestURI)
        Connect a WebSocket to the default client port, default client host and specified, relative request URI.
        Parameters:
        requestURI - the relative URI
      • rxConnect

        public rx.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:
      • connect

        public void connect​(io.vertx.core.http.WebSocketConnectOptions options,
                            io.vertx.core.Handler<io.vertx.core.AsyncResult<WebSocket>> handler)
        Connect a WebSocket with the specified options.
        Parameters:
        options - the request options
        handler -
      • connect

        public void connect​(io.vertx.core.http.WebSocketConnectOptions options)
        Connect a WebSocket with the specified options.
        Parameters:
        options - the request options
      • rxConnect

        public rx.Single<WebSocket> rxConnect​(io.vertx.core.http.WebSocketConnectOptions options)
        Connect a WebSocket with the specified options.
        Parameters:
        options - the request options
        Returns:
      • close

        public void close​(io.vertx.core.Handler<io.vertx.core.AsyncResult<Void>> handler)
        Close the client. Closing will close down any pooled connections. Clients should always be closed after use.
        Parameters:
        handler -
      • close

        public void close()
        Close the client. Closing will close down any pooled connections. Clients should always be closed after use.
      • rxClose

        public rx.Single<Void> rxClose()
        Close the client. Closing will close down any pooled connections. Clients should always be closed after use.
        Returns:
      • newInstance

        public static WebSocketClient newInstance​(io.vertx.core.http.WebSocketClient arg)