Package ej.websocket

Class Messages


  • public final class Messages
    extends Object
    Gather error messages.
    • Field Detail

      • OPCODE_NOT_MANAGED

        public static final int OPCODE_NOT_MANAGED
        We received an OP code that is not managed.
        See Also:
        Constant Field Values
      • INVALID_UTF8

        public static final int INVALID_UTF8
        We received an UTF8 frame that has an unvalid payload.
        See Also:
        Constant Field Values
      • UNSUPPORTED_MASKED

        public static final int UNSUPPORTED_MASKED
        This implementation does not support masked frame.
        See Also:
        Constant Field Values
      • UNSUPPORTED_VERY_EXTENDED_LENGTH

        public static final int UNSUPPORTED_VERY_EXTENDED_LENGTH
        This implementation does not support very extended length.
        See Also:
        Constant Field Values
      • INVALID_LENGTH

        public static final int INVALID_LENGTH
        Payload length cannot be greater than 125.
        See Also:
        Constant Field Values
      • INVALID_CLOSE_CODE

        public static final int INVALID_CLOSE_CODE
        The close code is not valid.
        See Also:
        Constant Field Values
      • INVALID_SEQUENCE

        public static final int INVALID_SEQUENCE
        An invalid sequence of fragmented frame arrived.
        See Also:
        Constant Field Values
      • TIMEOUT_START

        public static final int TIMEOUT_START
        A timeout has been set.
        See Also:
        Constant Field Values
      • TIMEOUT_NORMAL_CLOSE

        public static final int TIMEOUT_NORMAL_CLOSE
        The timeout has been closed normally.
        See Also:
        Constant Field Values
      • TIMEOUT_INTERRUPTED

        public static final int TIMEOUT_INTERRUPTED
        The timeout has been interrupted.
        See Also:
        Constant Field Values
      • RECEIVER_START

        public static final int RECEIVER_START
        The receiver is started.
        See Also:
        Constant Field Values
      • RECEIVER_FRAME_RECEIVED

        public static final int RECEIVER_FRAME_RECEIVED
        One frame has been received.
        See Also:
        Constant Field Values
      • RECEIVER_TERMINATED

        public static final int RECEIVER_TERMINATED
        If we get here and no exception occurred, it means that the connection has been closed. We don't have to call onClose() on the endpoint since the connection is already closed (and consequently onClose() has been called already.
        See Also:
        Constant Field Values
      • RECEIVER_TIMEOUT

        public static final int RECEIVER_TIMEOUT
        This case happens when the OnTimeOutCloser closes the underlying TCP connection. Hence, the websocket state is CLOSED and the TCP connection is closed so an IOException occurs in getFrame() because its calls read() on an invalid input stream. There is nothing to do since both websocket and TCP socket (and associated streams) are closed.
        See Also:
        Constant Field Values
      • VALID_PACKET_CONNECTION_CLOSED

        public static final int VALID_PACKET_CONNECTION_CLOSED
        We can receive valid packets if the connection is not in the OPEN state. Example: someone ask to close the connection (user can do this because it chooses to do so, validate() can this because we receive an invalid frame) so the connection moves to the CLOSING state. At this moment, we can receive a ping frame. handle() will try to response with a pong frame and an IllegalstateException will be raised.
        See Also:
        Constant Field Values
      • INVALID_FRAME

        public static final int INVALID_FRAME
        We received an invalid frame.
        See Also:
        Constant Field Values
      • RECEIVED_TEXT_FRAME

        public static final int RECEIVED_TEXT_FRAME
        We received a text frame.
        See Also:
        Constant Field Values
      • RECEIVED_BINARY_FRAME

        public static final int RECEIVED_BINARY_FRAME
        We received a binary frame.
        See Also:
        Constant Field Values
      • RECEIVED_CLOSE_FRAME

        public static final int RECEIVED_CLOSE_FRAME
        We received a close frame.
        See Also:
        Constant Field Values
      • RECEIVED_PING_FRAME

        public static final int RECEIVED_PING_FRAME
        We received a ping frame.
        See Also:
        Constant Field Values
      • RECEIVED_PONG_FRAME

        public static final int RECEIVED_PONG_FRAME
        We received a pong frame.
        See Also:
        Constant Field Values
      • ALREADY_CLOSE

        public static final int ALREADY_CLOSE
        The websocket is already closed.
        See Also:
        Constant Field Values
      • SEND_TEXT

        public static final int SEND_TEXT
        A send of text has been requested.
        See Also:
        Constant Field Values
      • SEND_BINARY

        public static final int SEND_BINARY
        A send of binary has been requested.
        See Also:
        Constant Field Values
      • RESPOND_CLOSING

        public static final int RESPOND_CLOSING
        Respond to a closing handshake.
        See Also:
        Constant Field Values
      • OPENING_HANDSHAKE

        public static final int OPENING_HANDSHAKE
        Sending the opening handshake.
        See Also:
        Constant Field Values
      • INVALID_STATUS

        public static final int INVALID_STATUS
        The status code is invalid.
        See Also:
        Constant Field Values
      • INVALID_UPGRADE

        public static final int INVALID_UPGRADE
        Invalid upgrade field.
        See Also:
        Constant Field Values
      • INVALID_CONNECTION

        public static final int INVALID_CONNECTION
        Invalid connection field.
        See Also:
        Constant Field Values
      • INVALID_SEC_WEBSOCKET_ACCEPT

        public static final int INVALID_SEC_WEBSOCKET_ACCEPT
        Missing Sec-WebSocket-Accept header.
        See Also:
        Constant Field Values
      • CATEGORY

        public static final String CATEGORY
        Category message errors.
      • BUILDER

        public static final MessageBuilder BUILDER
        The message builder.
    • Method Detail

      • log

        public static void log​(boolean log)
        Parameters:
        log -