|
|
|
@ -62,7 +62,7 @@ public class LoginProcessor extends AbstractMessageProcessor<IMLoginInfo> { |
|
|
|
AttributeKey<Integer> terminalAttr = AttributeKey.valueOf(ChannelAttrKey.TERMINAL_TYPE); |
|
|
|
ctx.channel().attr(terminalAttr).set(terminal); |
|
|
|
// 初始化心跳次数
|
|
|
|
AttributeKey<Long> heartBeatAttr = AttributeKey.valueOf("HEARTBEAt_TIMES"); |
|
|
|
AttributeKey<Long> heartBeatAttr = AttributeKey.valueOf(ChannelAttrKey.HEARTBEAT_TIMES); |
|
|
|
ctx.channel().attr(heartBeatAttr).set(0L); |
|
|
|
// 在redis上记录每个user的channelId,15秒没有心跳,则自动过期
|
|
|
|
String key = String.join(":", IMRedisKey.IM_USER_SERVER_ID, userId.toString(), terminal.toString()); |
|
|
|
|