Package ej.websocket
Class Messages
- java.lang.Object
-
- ej.websocket.Messages
-
public final class Messages extends Object
Gather error messages.
-
-
Field Summary
Fields Modifier and Type Field Description static intALREADY_CLOSEThe websocket is already closed.static MessageBuilderBUILDERThe message builder.static StringCATEGORYCategory message errors.static intCLOSEA close has been request.static intCLOSE_TCPClose TCP connection.static intERROR_UNKNOWNUnknown error.static intINVALID_CLOSE_CODEThe close code is not valid.static intINVALID_CONNECTIONInvalid connection field.static intINVALID_FRAMEWe received an invalid frame.static intINVALID_LENGTHPayload length cannot be greater than 125.static intINVALID_SEC_WEBSOCKET_ACCEPTMissing Sec-WebSocket-Accept header.static intINVALID_SEQUENCEAn invalid sequence of fragmented frame arrived.static intINVALID_STATUSThe status code is invalid.static intINVALID_UPGRADEInvalid upgrade field.static intINVALID_UTF8We received an UTF8 frame that has an unvalid payload.static MessageLoggerLOGGERThe message logger.static intNOT_FINThis is not a fin frame.static intOPCODE_NOT_MANAGEDWe received an OP code that is not managed.static intOPENING_HANDSHAKESending the opening handshake.static intPINGA ping has been requested.static intPONGA pong has been requested.static intRECEIVEReceive some data.static intRECEIVED_BINARY_FRAMEWe received a binary frame.static intRECEIVED_CLOSE_FRAMEWe received a close frame.static intRECEIVED_PING_FRAMEWe received a ping frame.static intRECEIVED_PONG_FRAMEWe received a pong frame.static intRECEIVED_TEXT_FRAMEWe received a text frame.static intRECEIVER_FRAME_RECEIVEDOne frame has been received.static intRECEIVER_STARTThe receiver is started.static intRECEIVER_TERMINATEDIf we get here and no exception occurred, it means that the connection has been closed.static intRECEIVER_TIMEOUTThis case happens when the OnTimeOutCloser closes the underlying TCP connection.static intRESPOND_CLOSINGRespond to a closing handshake.static intSEND_BINARYA send of binary has been requested.static intSEND_TEXTA send of text has been requested.static intSENDINGSending some data.static intTIMEOUTThe timeout has been reached.static intTIMEOUT_INTERRUPTEDThe timeout has been interrupted.static intTIMEOUT_NORMAL_CLOSEThe timeout has been closed normally.static intTIMEOUT_STARTA timeout has been set.static intUNSUPPORTED_MASKEDThis implementation does not support masked frame.static intUNSUPPORTED_VERY_EXTENDED_LENGTHThis implementation does not support very extended length.static intVALID_PACKET_CONNECTION_CLOSEDWe can receive valid packets if the connection is not in the OPEN state.
-
-
-
Field Detail
-
ERROR_UNKNOWN
public static final int ERROR_UNKNOWN
Unknown error.- See Also:
- Constant Field Values
-
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
-
NOT_FIN
public static final int NOT_FIN
This is not a fin frame.- 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
public static final int TIMEOUT
The timeout has been reached.- 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
-
CLOSE
public static final int CLOSE
A close has been request.- 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
-
PING
public static final int PING
A ping has been requested.- See Also:
- Constant Field Values
-
PONG
public static final int PONG
A pong 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
-
CLOSE_TCP
public static final int CLOSE_TCP
Close TCP connection.- See Also:
- Constant Field Values
-
RECEIVE
public static final int RECEIVE
Receive some data.- See Also:
- Constant Field Values
-
OPENING_HANDSHAKE
public static final int OPENING_HANDSHAKE
Sending the opening handshake.- See Also:
- Constant Field Values
-
SENDING
public static final int SENDING
Sending some data.- 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.
-
LOGGER
public static MessageLogger LOGGER
The message logger.
-
-