Class IOState


  • public class IOState
    extends Object
    Simple state tracker for Input / Output and ConnectionState.

    Use the various known .on*() methods to trigger a state change.

    • Method Detail

      • getCloseInfo

        public CloseInfo getCloseInfo()
      • isClosed

        public boolean isClosed()
      • isInputAvailable

        public boolean isInputAvailable()
      • isOpen

        public boolean isOpen()
      • isOutputAvailable

        public boolean isOutputAvailable()
      • onAbnormalClose

        public void onAbnormalClose​(CloseInfo close)
        A websocket connection has been disconnected for abnormal close reasons.

        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.

        Parameters:
        close - the close information
      • onCloseLocal

        public void onCloseLocal​(CloseInfo closeInfo)
        A close handshake has been issued from the local endpoint
        Parameters:
        closeInfo - the close information
      • onCloseRemote

        public void onCloseRemote​(CloseInfo closeInfo)
        A close handshake has been received from the remote endpoint
        Parameters:
        closeInfo - the close information
      • onFailedUpgrade

        public void onFailedUpgrade()
        A websocket connection has failed its upgrade handshake, and is now closed.
      • onOpened

        public void onOpened()
        A websocket connection has finished its upgrade handshake, and is now open.
      • onReadFailure

        public void onReadFailure​(Throwable t)
        The local endpoint has reached a read failure.

        This could be a normal result after a proper close handshake, or even a premature close due to a connection disconnect.

        Parameters:
        t - the read failure
      • onWriteFailure

        public void onWriteFailure​(Throwable t)
        The local endpoint has reached a write failure.

        A low level I/O failure, or even a jetty side EndPoint close (from idle timeout) are a few scenarios

        Parameters:
        t - the throwable that caused the write failure
      • onDisconnected

        public void onDisconnected()
      • wasAbnormalClose

        public boolean wasAbnormalClose()
      • wasCleanClose

        public boolean wasCleanClose()
      • wasLocalCloseInitiated

        public boolean wasLocalCloseInitiated()
      • wasRemoteCloseInitiated

        public boolean wasRemoteCloseInitiated()