IOState

Simple state tracker for Input / Output and {@link WebSocketConnectionState}. <p> Use the various known .on*() methods to trigger a state change. <ul> <li>{@link #onOpened()} - connection has been opened</li> </ul>

Constructors

this
this()

Create a new IOState, initialized to {@link WebSocketConnectionState#CONNECTING}

Members

Functions

addListener
void addListener(ConnectionStateListener listener)
Undocumented in source. Be warned that the author may not have intended to support it.
assertInputOpen
void assertInputOpen()
Undocumented in source. Be warned that the author may not have intended to support it.
assertOutputOpen
void assertOutputOpen()
Undocumented in source. Be warned that the author may not have intended to support it.
getCloseInfo
CloseInfo getCloseInfo()
Undocumented in source. Be warned that the author may not have intended to support it.
getConnectionState
WebSocketConnectionState getConnectionState()
Undocumented in source. Be warned that the author may not have intended to support it.
isClosed
bool isClosed()
Undocumented in source. Be warned that the author may not have intended to support it.
isInputAvailable
bool isInputAvailable()
Undocumented in source. Be warned that the author may not have intended to support it.
isOpen
bool isOpen()
Undocumented in source. Be warned that the author may not have intended to support it.
isOutputAvailable
bool isOutputAvailable()
Undocumented in source. Be warned that the author may not have intended to support it.
onAbnormalClose
void onAbnormalClose(CloseInfo close)

A websocket connection has been disconnected for abnormal close reasons. <p> This is the low level disconnect of the socket. It could be the result of a normal close operation, from an IO error, or even from a timeout.

onCloseLocal
void onCloseLocal(CloseInfo closeInfo)

A close handshake has been issued from the local endpoint

onCloseRemote
void onCloseRemote(CloseInfo closeInfo)

A close handshake has been received from the remote endpoint

onConnected
void onConnected()

WebSocket has successfully upgraded, but the end-user onOpen call hasn't run yet. <p> This is an intermediate state between the RFC's {@link WebSocketConnectionState#CONNECTING} and {@link WebSocketConnectionState#OPEN}

onDisconnected
void onDisconnected()
Undocumented in source. Be warned that the author may not have intended to support it.
onFailedUpgrade
void onFailedUpgrade()

A websocket connection has failed its upgrade handshake, and is now closed.

onOpened
void onOpened()

A websocket connection has finished its upgrade handshake, and is now open.

onReadFailure
void onReadFailure(Throwable t)

The local endpoint has reached a read failure. <p> This could be a normal result after a proper close handshake, or even a premature close due to a connection disconnect.

onWriteFailure
void onWriteFailure(Throwable t)

The local endpoint has reached a write failure. <p> A low level I/O failure, or even a hunt side EndPoint close (from idle timeout) are a few scenarios

toString
string toString()
Undocumented in source. Be warned that the author may not have intended to support it.
wasAbnormalClose
bool wasAbnormalClose()
Undocumented in source. Be warned that the author may not have intended to support it.
wasCleanClose
bool wasCleanClose()
Undocumented in source. Be warned that the author may not have intended to support it.
wasLocalCloseInitiated
bool wasLocalCloseInitiated()
Undocumented in source. Be warned that the author may not have intended to support it.
wasRemoteCloseInitiated
bool wasRemoteCloseInitiated()
Undocumented in source. Be warned that the author may not have intended to support it.

Meta