Package io.muserver

Enum WebsocketSessionState

    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
      CLIENT_CLOSED
      The session has ended as a result of the client sending a close frame
      CLIENT_CLOSING
      The client has sent a close frame.
      DISCONNECTED
      The connection was disconnected early (before a graceful shutdown could occur)
      ERRORED
      The session was ended due to an unexpected error
      NOT_STARTED
      The session has not started yet
      OPEN
      The session is running and messages can be written and received
      SERVER_CLOSED
      The connection has ended due to a server-initiated shutdown
      SERVER_CLOSING
      The server has sent a close frame to the client, but the connection is not yet closed
      TIMED_OUT
      The session was disconnected because no messages were received in the time period configured with WebSocketHandlerBuilder.withIdleReadTimeout(long, TimeUnit)
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean closing()  
      boolean endState()  
      static WebsocketSessionState valueOf​(java.lang.String name)
      Returns the enum constant of this type with the specified name.
      static WebsocketSessionState[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      • Methods inherited from class java.lang.Enum

        clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
    • Enum Constant Detail

      • OPEN

        public static final WebsocketSessionState OPEN
        The session is running and messages can be written and received
      • ERRORED

        public static final WebsocketSessionState ERRORED
        The session was ended due to an unexpected error
      • CLIENT_CLOSED

        public static final WebsocketSessionState CLIENT_CLOSED
        The session has ended as a result of the client sending a close frame
      • CLIENT_CLOSING

        public static final WebsocketSessionState CLIENT_CLOSING
        The client has sent a close frame. The server is yet to close the connection on its side.
      • SERVER_CLOSING

        public static final WebsocketSessionState SERVER_CLOSING
        The server has sent a close frame to the client, but the connection is not yet closed
      • SERVER_CLOSED

        public static final WebsocketSessionState SERVER_CLOSED
        The connection has ended due to a server-initiated shutdown
      • DISCONNECTED

        public static final WebsocketSessionState DISCONNECTED
        The connection was disconnected early (before a graceful shutdown could occur)
    • Method Detail

      • values

        public static WebsocketSessionState[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (WebsocketSessionState c : WebsocketSessionState.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static WebsocketSessionState valueOf​(java.lang.String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.NullPointerException - if the argument is null
      • endState

        public boolean endState()
        Returns:
        True if the websocket session has ended for any reason
      • closing

        public boolean closing()
        Returns:
        True if the shutdown handshake has started (but not completed)