N2 定时心跳客户端检测
2023-09-08 14:26:19 0 举报
客户端定时心跳客户端检测
作者其他创作
大纲/内容
unregister(outDateConnectionId)
clientConnectionEventListener.clientDisConnected(connection)
NotifyCenter.publishEvent(new ClientEvent.ClientDisconnectEvent(client))
ClientServiceIndexesManager#onEvent
clientConnectionEventListenerRegistry.notifyClientDisConnected(remove)
客户端探活服务端,如果response.isSuccess()->successConnections.add(outDateConnectionId)
服务端健康检查
this.connections.remove(connectionId)
handleClientDisconnect()
遍历过期集合且不存在成功集合中(if (!successConnections.contains(outDateConnectionId))),注销实例
clients.remove(clientId)
@PostConstructConnectionManager#start()
syncToVerifyFailedServer
ConnectionBasedClientManager#clientDisConnected
if (now - client.getMetaInfo().getLastActiveTime() >= KEEP_ALIVE_TIME)如果20s内没有接收到客户端心跳,将客户端添加到过期集合中
client.release()
outDatedConnections.add(client.getMetaInfo().getConnectionId())
DistroClientDataProcessor#onEvent
0 条评论
下一页