|
@@ -47,7 +47,7 @@ public class DiscardServerHandler extends ChannelInboundHandlerAdapter {
|
|
|
private static String PREFIX_LINK = "s.";
|
|
|
private static String PREFIX_DEVICE = "d.";
|
|
|
|
|
|
- public static Map<Channel, String> channelMap = new HashMap<Channel, String>();
|
|
|
+ public static Map<String, String> channelMap = new HashMap<String, String>();
|
|
|
public static Map<String, Channel> manageChannelMap = new HashMap<>();
|
|
|
public static Map<String, String> commandCopy = new HashMap<>();
|
|
|
|
|
@@ -71,7 +71,7 @@ public class DiscardServerHandler extends ChannelInboundHandlerAdapter {
|
|
|
String deviceId = advice.getDeviceId();
|
|
|
String adviceType = advice.getAdviceType();
|
|
|
Channel channel = ctx.channel();
|
|
|
- String deviceIdInMap = channelMap.get(channel);
|
|
|
+ String deviceIdInMap = channelMap.get(channel.id().asLongText());
|
|
|
if (deviceIdInMap == null) {
|
|
|
manageLink(channel, deviceId);
|
|
|
}
|
|
@@ -101,10 +101,10 @@ public class DiscardServerHandler extends ChannelInboundHandlerAdapter {
|
|
|
}
|
|
|
|
|
|
private void manageLink(Channel channel, String deviceIdInMap) {
|
|
|
- logger.info("链接管理。。。。");
|
|
|
String channelId = channel.id().asLongText();
|
|
|
manageChannelMap.put(channelId, channel);
|
|
|
- channelMap.put(channel, deviceIdInMap);
|
|
|
+ channelMap.put(channelId, deviceIdInMap);
|
|
|
+ logger.info("链接管理,链接id [{}]", channelId);
|
|
|
|
|
|
ConnectMsg cMsg = new ConnectMsg("10.27.118.76", channelId);
|
|
|
try (Jedis jedis = jedisPool.getResource()) {
|