public class IOState extends Object
ConnectionState
.
Use the various known .on*() methods to trigger a state change.
onOpened()
- connection has been openedModifier and Type | Class and Description |
---|---|
static interface |
IOState.ConnectionStateListener |
Constructor and Description |
---|
IOState()
Create a new IOState, initialized to
ConnectionState.CONNECTING |
Modifier and Type | Method and Description |
---|---|
void |
addListener(IOState.ConnectionStateListener listener) |
void |
assertInputOpen() |
void |
assertOutputOpen() |
CloseInfo |
getCloseInfo() |
ConnectionState |
getConnectionState() |
boolean |
isClosed() |
boolean |
isInputAvailable() |
boolean |
isOpen() |
boolean |
isOutputAvailable() |
void |
onAbnormalClose(CloseInfo close)
A websocket connection has been disconnected for abnormal close reasons.
|
void |
onCloseLocal(CloseInfo close)
A close handshake has been issued from the local endpoint
|
void |
onCloseRemote(CloseInfo close)
A close handshake has been received from the remote endpoint
|
void |
onConnected()
WebSocket has successfully upgraded, but the end-user onOpen call hasn't run yet.
|
void |
onDisconnected() |
void |
onFailedUpgrade()
A websocket connection has failed its upgrade handshake, and is now closed.
|
void |
onOpened()
A websocket connection has finished its upgrade handshake, and is now open.
|
void |
onReadFailure(Throwable t)
The local endpoint has reached a read failure.
|
void |
onWriteFailure(Throwable t)
The local endpoint has reached a write failure.
|
String |
toString() |
boolean |
wasAbnormalClose() |
boolean |
wasCleanClose() |
boolean |
wasLocalCloseInitiated() |
boolean |
wasRemoteCloseInitiated() |
public IOState()
ConnectionState.CONNECTING
public void addListener(IOState.ConnectionStateListener listener)
public void assertInputOpen() throws IOException
IOException
public void assertOutputOpen() throws IOException
IOException
public CloseInfo getCloseInfo()
public ConnectionState getConnectionState()
public boolean isClosed()
public boolean isInputAvailable()
public boolean isOpen()
public boolean isOutputAvailable()
public void onAbnormalClose(CloseInfo close)
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.
public void onCloseLocal(CloseInfo close)
public void onCloseRemote(CloseInfo close)
public void onConnected()
This is an intermediate state between the RFC's ConnectionState.CONNECTING
and ConnectionState.OPEN
public void onFailedUpgrade()
public void onOpened()
public void onReadFailure(Throwable t)
This could be a normal result after a proper close handshake, or even a premature close due to a connection disconnect.
public void onWriteFailure(Throwable t)
A low level I/O failure, or even a jetty side EndPoint close (from idle timeout) are a few scenarios
public void onDisconnected()
public boolean wasAbnormalClose()
public boolean wasCleanClose()
public boolean wasLocalCloseInitiated()
public boolean wasRemoteCloseInitiated()
Copyright © 1995-2015 Webtide. All Rights Reserved.