Enum Class ReconnectReason

java.lang.Object
java.lang.Enum<ReconnectReason>
io.github.theword.queqiao.core.websocket.ReconnectReason
All Implemented Interfaces:
Serializable, Comparable<ReconnectReason>, Constable

public enum ReconnectReason extends Enum<ReconnectReason>
重连原因

所有重连请求都必须携带原因,统一进入 WsClient 的重连 pipeline。

说明:不存在 "CONNECTION_ERROR" 这一原因。 WsClient.onError(Exception) 只记录错误、不安排重连—— Java-WebSocket 在连接失败与异常关闭时都会随后触发 onClose, 由 onClose 作为自动重连的唯一入口,避免一次故障被安排两次重连。

Since:
0.6.11
  • Enum Constant Details

    • REMOTE_CLOSE

      public static final ReconnectReason REMOTE_CLOSE
      连接层关闭(含连接失败、异常关闭、心跳超时被库关闭)
    • MANUAL

      public static final ReconnectReason MANUAL
      手动触发(管理员命令)
  • Method Details

    • values

      public static ReconnectReason[] 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 ReconnectReason 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