Enum Class SocketCloseReason

java.lang.Object
java.lang.Enum<SocketCloseReason>
com.github.twitch4j.eventsub.socket.domain.SocketCloseReason
All Implemented Interfaces:
Serializable, Comparable<SocketCloseReason>, Constable

public enum SocketCloseReason extends Enum<SocketCloseReason>
The reasons for closing the eventsub websocket connection.
  • Enum Constant Details

    • INTERNAL_SERVER_ERROR

      public static final SocketCloseReason INTERNAL_SERVER_ERROR
      Indicates a problem with the server (similar to an HTTP 500 status code).
    • CLIENT_SENT_INBOUND_TRAFFIC

      public static final SocketCloseReason CLIENT_SENT_INBOUND_TRAFFIC
      Sending outgoing messages to the server is prohibited with the exception of pong messages.
    • CLIENT_FAILED_PING_PONG

      public static final SocketCloseReason CLIENT_FAILED_PING_PONG
      You must respond to ping messages with a pong message.
    • CONNECTION_UNUSED

      public static final SocketCloseReason CONNECTION_UNUSED
      When you connect to the server, you must create a subscription within 10 seconds or the connection is closed. The time limit is subject to change.
    • RECONNECT_GRACE_TIME_EXPIRED

      public static final SocketCloseReason RECONNECT_GRACE_TIME_EXPIRED
      When you receive a session_reconnect message, you have 30 seconds to reconnect to the server and close the old connection.
    • NETWORK_TIMEOUT

      public static final SocketCloseReason NETWORK_TIMEOUT
      Transient network timeout.
    • NETWORK_ERROR

      public static final SocketCloseReason NETWORK_ERROR
      Transient network error.
    • INVALID_RECONNECT

      public static final SocketCloseReason INVALID_RECONNECT
      The reconnect URL is invalid.
  • Field Details

  • Method Details

    • values

      public static SocketCloseReason[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static SocketCloseReason valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (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:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • getCode

      public int getCode()