Enum Class ReconnectReason
- All Implemented Interfaces:
Serializable,Comparable<ReconnectReason>,Constable
重连原因
所有重连请求都必须携带原因,统一进入 WsClient 的重连 pipeline。
说明:不存在 "CONNECTION_ERROR" 这一原因。
WsClient.onError(Exception) 只记录错误、不安排重连——
Java-WebSocket 在连接失败与异常关闭时都会随后触发 onClose,
由 onClose 作为自动重连的唯一入口,避免一次故障被安排两次重连。
- Since:
- 0.6.11
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum Constants -
Method Summary
Modifier and TypeMethodDescriptionstatic ReconnectReasonReturns the enum constant of this class with the specified name.static ReconnectReason[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
REMOTE_CLOSE
连接层关闭(含连接失败、异常关闭、心跳超时被库关闭) -
MANUAL
手动触发(管理员命令)
-
-
Method Details
-
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
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 nameNullPointerException- if the argument is null
-