Class ReconnectCommand
java.lang.Object
io.github.theword.queqiao.core.command.SubCommand
io.github.theword.queqiao.core.command.subCommand.client.ReconnectCommand
-
Field Summary
Fields inherited from class io.github.theword.queqiao.core.command.SubCommand
children, parent -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class io.github.theword.queqiao.core.command.SubCommand
addChild, execute, getChildren, getFullPath, getFullPermissionNode, getParent, getPermissionNode, isRoot, sendCommandTree
-
Constructor Details
-
ReconnectCommand
public ReconnectCommand()
-
-
Method Details
-
getName
获取命令名称- Specified by:
getNamein classSubCommand- Returns:
- reconnect
-
getDescription
获取命令描述- Specified by:
getDescriptionin classSubCommand- Returns:
- 重新连接 Websocket Clients
-
getUsage
获取命令用法(添加参数说明)- Overrides:
getUsagein classSubCommand- Returns:
- 使用说明
-
onExecute
重连 WebSocket 客户端 reconnect 命令调用- Specified by:
onExecutein classSubCommand- Parameters:
commandReturner- 命令执行者args- 命令参数
-
reconnect
重连 WebSocket 客户端all的语义:false—— 只重连未打开的客户端(/queqiao client reconnect)true—— 强制重连全部客户端,含当前健康的连接 (/queqiao client reconnect all),会主动断开再重建
注意:本方法只是把重连任务投递到调度器,并不保证连接成功, 因此结束提示为"已安排重连"而非"已重新连接";真正的结果由
WsClient在onOpen/onClose中记录到日志。- Parameters:
commandReturner- 命令执行者all- 是否强制重连全部客户端
-