Interface WebSocket.Builder

    • Method Detail

      • buildAsync

        CompletableFuture<WebSocket> buildAsync​(WebSocket.Listener listener)
        Builds a new WebSocket connection and waits asynchronously until the connection is opened. The listener onOpen callback is called before the returned future is completed.
        Parameters:
        listener -
        Returns:
        CompletableFuture which is completed after connection is opened
      • subprotocol

        WebSocket.Builder subprotocol​(String protocol)
        Protocol used for WebSocket message exchange.
        The client can request that the server use a specific subprotocol by including the |Sec-WebSocket-Protocol| field in its handshake. If it is specified, the server needs to include the same field and one of the selected subprotocol values in its response for the connection to be established.
        RFC 6455: Section 1.9, Subprotocols Using the WebSocket Protocol
        Parameters:
        protocol - the protocol to be used.
        Returns:
        this builder.