Class AbstractWebSocketProcessor

    • Constructor Detail

    • Method Detail

      • onMessage

        public void onMessage​(byte[] data,
                              int offset,
                              int length)
        Description copied from interface: IWebSocketProcessor
        Called when a binary message arrives from the client
        Specified by:
        onMessage in interface IWebSocketProcessor
        Parameters:
        data - the binary message from the client
        offset - the offset to read from
        length - how much data to read
      • onClose

        public void onClose​(int closeCode,
                            String message)
        Description copied from interface: IWebSocketProcessor
        A notification after the close of the web socket connection. The connection could be closed by either the client or the server
        Specified by:
        onClose in interface IWebSocketProcessor
        Parameters:
        closeCode - The close code
        message - the message
      • broadcastMessage

        public final void broadcastMessage​(IWebSocketMessage message,
                                           IWebSocketConnection connection,
                                           boolean asynchronousPush,
                                           long timeout)
        Exports the Wicket thread locals and broadcasts the received message from the client to all interested components and behaviors in the page with id #pageId

        Note: ConnectedMessage and ClosedMessage messages are notification-only. I.e. whatever the components/behaviors write in the WebSocketRequestHandler will be ignored because the protocol doesn't expect response from the user.

        Parameters:
        message - the message to broadcast
        connection - the IWebSocketConnection
        asynchronousPush - whether asynchronous pus is used or not
        timeout - The time ut to use for operation (in milliseconds). A negative value means use default timeout (specified by container).