mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-21 11:35:12 +08:00
channel工具类
This commit is contained in:
@@ -45,7 +45,7 @@ public class ElectricBicyclesServerHandler extends ChannelInboundHandlerAdapter
|
||||
//获取连接通道唯一标识
|
||||
ChannelId channelId = ctx.channel().id();
|
||||
//如果map中不包含此连接,就保存连接
|
||||
ChannelManagerUtil.addChannel(channelId.asShortText(), ctx);
|
||||
ChannelManagerUtil.addChannel(channelId, ctx);
|
||||
// if (CHANNEL_MAP.containsKey(channelId)) {
|
||||
// log.info("客户端【{}】是连接状态,连接通道数量: {}", channelId, CHANNEL_MAP.size());
|
||||
// } else {
|
||||
@@ -90,7 +90,7 @@ public class ElectricBicyclesServerHandler extends ChannelInboundHandlerAdapter
|
||||
String clientIp = insocket.getAddress().getHostAddress();
|
||||
ChannelId channelId = ctx.channel().id();
|
||||
//包含此客户端才去删除
|
||||
ChannelManagerUtil.removeChannel(channelId.asShortText());
|
||||
ChannelManagerUtil.removeChannel(channelId);
|
||||
// if (CHANNEL_MAP.containsKey(channelId)) {
|
||||
// ykcService.exit(channelId);
|
||||
// //删除连接
|
||||
|
||||
Reference in New Issue
Block a user