Package io.muserver
Enum WebsocketSessionState
- java.lang.Object
-
- java.lang.Enum<WebsocketSessionState>
-
- io.muserver.WebsocketSessionState
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Comparable<WebsocketSessionState>
public enum WebsocketSessionState extends java.lang.Enum<WebsocketSessionState>
The state of a websocket session
-
-
Enum Constant Summary
Enum Constants Enum Constant Description CLIENT_CLOSED
The session has ended as a result of the client sending a close frameCLIENT_CLOSING
The client has sent a close frame.DISCONNECTED
The connection was disconnected early (before a graceful shutdown could occur)ERRORED
The session was ended due to an unexpected errorNOT_STARTED
The session has not started yetOPEN
The session is running and messages can be written and receivedSERVER_CLOSED
The connection has ended due to a server-initiated shutdownSERVER_CLOSING
The server has sent a close frame to the client, but the connection is not yet closedTIMED_OUT
The session was disconnected because no messages were received in the time period configured withWebSocketHandlerBuilder.withIdleReadTimeout(long, TimeUnit)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
closing()
boolean
endState()
static WebsocketSessionState
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.static WebsocketSessionState[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
NOT_STARTED
public static final WebsocketSessionState NOT_STARTED
The session has not started yet
-
OPEN
public static final WebsocketSessionState OPEN
The session is running and messages can be written and received
-
ERRORED
public static final WebsocketSessionState ERRORED
The session was ended due to an unexpected error
-
CLIENT_CLOSED
public static final WebsocketSessionState CLIENT_CLOSED
The session has ended as a result of the client sending a close frame
-
CLIENT_CLOSING
public static final WebsocketSessionState CLIENT_CLOSING
The client has sent a close frame. The server is yet to close the connection on its side.
-
SERVER_CLOSING
public static final WebsocketSessionState SERVER_CLOSING
The server has sent a close frame to the client, but the connection is not yet closed
-
SERVER_CLOSED
public static final WebsocketSessionState SERVER_CLOSED
The connection has ended due to a server-initiated shutdown
-
DISCONNECTED
public static final WebsocketSessionState DISCONNECTED
The connection was disconnected early (before a graceful shutdown could occur)
-
TIMED_OUT
public static final WebsocketSessionState TIMED_OUT
The session was disconnected because no messages were received in the time period configured withWebSocketHandlerBuilder.withIdleReadTimeout(long, TimeUnit)
-
-
Method Detail
-
values
public static WebsocketSessionState[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (WebsocketSessionState c : WebsocketSessionState.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static WebsocketSessionState valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is null
-
endState
public boolean endState()
- Returns:
- True if the websocket session has ended for any reason
-
closing
public boolean closing()
- Returns:
- True if the shutdown handshake has started (but not completed)
-
-