Class WebSocketSessionState

java.lang.Object
org.eclipse.jetty.websocket.core.internal.WebSocketSessionState

public class WebSocketSessionState extends Object
Atomic Connection State
  • Constructor Details

    • WebSocketSessionState

      public WebSocketSessionState()
  • Method Details

    • onConnected

      public void onConnected()
    • onOpen

      public void onOpen()
    • isClosed

      public boolean isClosed()
    • isInputOpen

      public boolean isInputOpen()
    • isOutputOpen

      public boolean isOutputOpen()
    • getCloseStatus

      public CloseStatus getCloseStatus()
    • onClosed

      public boolean onClosed(CloseStatus closeStatus)
    • onError

      public void onError(Throwable t)

      If no error is set in the CloseStatus this will either, replace the current close status with a CloseStatus.SERVER_ERROR status if we had a NORMAL close code, or, it will set the cause of the CloseStatus if the previous cause was null, this allows onError to be notified after the connection is closed.

      This should only be called if there is an error directly before the call to WebSocketCoreSession.closeConnection(CloseStatus, Callback).

      This could occur if the FrameHandler throws an exception in onFrame after receiving a close frame reply, in this case to notify onError we must set the cause in the closeStatus.

      Parameters:
      t - the error which occurred.
    • onEof

      public boolean onEof()
    • onOutgoingFrame

      public boolean onOutgoingFrame(Frame frame) throws Exception
      Throws:
      Exception
    • onIncomingFrame

      public boolean onIncomingFrame(Frame frame) throws ProtocolException, ClosedChannelException
      Throws:
      ProtocolException
      ClosedChannelException
    • toString

      public String toString()
      Overrides:
      toString in class Object