Class ConnectionState
java.lang.Object
org.eclipse.jetty.websocket.common.io.ConnectionState
WebSocket Connection State.
State
can only go in one direction from HANDSHAKING
to DISCONNECTED
.
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final AtomicReference
<ConnectionState.State> private final AtomicBoolean
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
Tests to see if state allows for reading of WebSocket framesboolean
Test to see if state allows writing of WebSocket framesboolean
closing()
The Local Endpoint wants to close.boolean
Final Terminal state indicating the connection is disconnectedboolean
opened()
Requests that the connection migrate to OPENED stateboolean
opening()
Requests that the connection migrate to OPENING statetoString()
private String
toString
(ConnectionState.State state) boolean
Tests to see if state got past the initial HANDSHAKING state
-
Field Details
-
state
-
wasOpened
-
-
Constructor Details
-
ConnectionState
public ConnectionState()
-
-
Method Details
-
canWriteWebSocketFrames
public boolean canWriteWebSocketFrames()Test to see if state allows writing of WebSocket frames- Returns:
- true if state allows for writing of websocket frames
-
canReadWebSocketFrames
public boolean canReadWebSocketFrames()Tests to see if state allows for reading of WebSocket frames- Returns:
- true if state allows for reading of websocket frames
-
wasOpened
public boolean wasOpened()Tests to see if state got past the initial HANDSHAKING state- Returns:
- true if the connection state was opened
-
opening
public boolean opening()Requests that the connection migrate to OPENING state- Returns:
- true if OPENING state attained
-
opened
public boolean opened()Requests that the connection migrate to OPENED state- Returns:
- true if OPENED state attained
-
closing
public boolean closing()The Local Endpoint wants to close.- Returns:
- true if this is the first local close
-
disconnected
public boolean disconnected()Final Terminal state indicating the connection is disconnected- Returns:
- true if disconnected reached for the first time
-
toString
-
toString
-