public enum ConnectionStates extends Enum<ConnectionStates>
This enum type add a additional state, NEW
. It indicate that the Websocket object has been created but the WebSocket.connect()
method has not been already called. Hence, the WebSocket
is not yet in the CONNECTING
state.
Enum Constant and Description |
---|
CLOSED
State once the underlying TCP connection is closed.
|
CLOSING
State "upon either sending or receiving a Close control frame".
|
CONNECTING
Initial state of the websocket in the RFC6455.
|
NEW
The
WebSocket Java object has been created but its WebSocket.connect() method has not been called yet. |
OPEN
State once the opening handshake is done.
|
Modifier and Type | Method and Description |
---|---|
static ConnectionStates |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static ConnectionStates[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final ConnectionStates CLOSED
See section 7.1.4. The WebSocket Connection is Closed.
public static final ConnectionStates CLOSING
See section 7.1.3. The WebSocket Closing Handshake is Started.
public static final ConnectionStates CONNECTING
WebSocket.connect()
method is called.
See section 4.1. Client Requirements.
public static final ConnectionStates NEW
WebSocket
Java object has been created but its WebSocket.connect()
method has not been called yet.public static final ConnectionStates OPEN
See end of section 4.1. Client Requirements.
public static ConnectionStates valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullpublic static ConnectionStates[] values()
for (ConnectionStates c : ConnectionStates.values()) System.out.println(c);