Class JavaxWebSocketConnection

    • Method Detail

      • isOpen

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

        public void close​(int code,
                          String reason)
        Description copied from interface: IWebSocketConnection
        Closes the underlying web socket connection
        Parameters:
        code - the status code
        reason - the reason to close the connection
      • sendMessageAsync

        public Future<VoidsendMessageAsync​(String message,
                                             long timeOut)
        Description copied from interface: IWebSocketConnection
        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

        public IWebSocketConnection sendMessage​(byte[] message,
                                                int offset,
                                                int length)
                                         throws IOException
        Description copied from interface: IWebSocketConnection
        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

        public Future<VoidsendMessageAsync​(byte[] message,
                                             int offset,
                                             int length)
        Description copied from interface: IWebSocketConnection
        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

        public Future<VoidsendMessageAsync​(byte[] message,
                                             int offset,
                                             int length,
                                             long timeOut)
        Description copied from interface: IWebSocketConnection
        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