Interface IWebSocketConnection

    • Method Detail

      • isOpen

        boolean isOpen()
        Returns:
        true when the underlying native web socket connection is still open.
      • close

        void close​(int code,
                   String reason)
        Closes the underlying web socket connection
        Parameters:
        code - the status code
        reason - the reason to close the connection
      • sendMessageAsync

        Future<VoidsendMessageAsync​(String message)
        Sends a text message to the client in an asynchronous way.
        Parameters:
        message - the text message
        Returns:
        a Future representing the send operation
      • sendMessageAsync

        Future<VoidsendMessageAsync​(String message,
                                      long timeout)
        Sends a text message to the client in an asynchronous way.
        Parameters:
        message - the text message
        timeout - the timeout for operation
        Returns:
        a Future representing the send operation
      • sendMessage

        IWebSocketConnection sendMessage​(byte[] message,
                                         int offset,
                                         int length)
                                  throws IOException
        Sends a binary message to the client.
        Parameters:
        message - the binary message
        offset - the offset to read from
        length - how much data to read
        Returns:
        this object, for chaining methods
        Throws:
        IOException - when an IO error occurs during the write to the client
      • sendMessageAsync

        Future<VoidsendMessageAsync​(byte[] message,
                                      int offset,
                                      int length)
        Sends a binary message to the client in an asynchronous way.
        Parameters:
        message - the binary message
        offset - the offset to read from
        length - how much data to read
        Returns:
        a Future representing the send operation
      • sendMessageAsync

        Future<VoidsendMessageAsync​(byte[] message,
                                      int offset,
                                      int length,
                                      long timeout)
        Sends a binary message to the client in an asynchronous way.
        Parameters:
        message - the binary message
        offset - the offset to read from
        length - how much data to read
        timeout - the timeout for operation
        Returns:
        a Future representing the send operation
      • sendMessage

        void sendMessage​(IWebSocketPushMessage message)
        Broadcasts a push message to the wicket page (and it's components) associated with this connection. The components can then send messages or component updates to client by adding them to the target.
        Parameters:
        message - the push message to send
        Since:
        6.4
      • sendMessageAsync

        void sendMessageAsync​(IWebSocketPushMessage message)
        Broadcasts a push message to the wicket page (and it's components) associated with this connection. The components can then send messages or component updates to client by adding them to the target. Pushing to client is done asynchronously.
        Parameters:
        message - the push message to send
      • sendMessageAsync

        void sendMessageAsync​(IWebSocketPushMessage message,
                              long timeout)
        Broadcasts a push message to the wicket page (and it's components) associated with this connection. The components can then send messages or component updates to client by adding them to the target. Pushing to client is done asynchronously.
        Parameters:
        message - the push message to send
        timeout - the timeout in milliseconds
      • getSessionId

        String getSessionId()
        Returns:
        The id of the session for which this WebSocket connection is registered
      • getKey

        IKey getKey()
        Returns:
        The registry key for which this WebSocket connection is registered