Class WebSocketConnectionClient

    • Field Detail

      • address

        protected java.lang.String address
        The connection address.
      • websocket

        protected com.neovisionaries.ws.client.WebSocket websocket
        The websocket.
    • Method Detail

      • connect

        public IFuture<IWebSocketConnection> connect()
        Establishes the connection.
        Returns:
        This object when done, exception on connection error.
      • sendMessage

        public IFuture<java.lang.Integer> sendMessage​(byte[] header,
                                                      byte[] body)
        Send bytes using the connection.
        Parameters:
        header - The message header.
        body - The message body.
        Returns:
        A future indicating success.
      • close

        public void close()
        Closes the connection (ignored if already closed).
      • forceClose

        public void forceClose()
        Forcibly closes the connection (ignored if already closed).
      • sendAsFrames

        protected void sendAsFrames​(byte[] data)
        Fragment and send data as websocket frames.
        Parameters:
        data - The data.
        fut - The future.