Pu Zhibing
2025-03-11 19c823c2c8df4cceee0d827fb598e7f0d9b69154
ruoyi-service/ruoyi-dataInterchange/src/main/java/com/ruoyi/dataInterchange/netty/client/ChannelMap.java
@@ -34,8 +34,9 @@
    * @param key
    * @param channel
    */
   public static void addClientChannel(int key, ChannelId channel) {
      CLIENT_ID_MAP.put(key, channel);
   public static void addClientChannel(int key, Channel channel) {
      CLIENT_ID_MAP.put(key, channel.id());
      CLIENT_GROUP.add(channel);
   }
   
   
@@ -47,6 +48,9 @@
    */
   public static Channel getClientChannel(int key) {
      ChannelId channelId = CLIENT_ID_MAP.get(key);
      if (null == channelId) {
         return null;
      }
      Channel channel = CLIENT_GROUP.find(channelId);
      return channel;
   }
@@ -58,8 +62,9 @@
    * @param key
    * @param channel
    */
   public static void addServerChannel(int key, ChannelId channel) {
      SERVER_ID_MAP.put(key, channel);
   public static void addServerChannel(int key, Channel channel) {
      SERVER_ID_MAP.put(key, channel.id());
      SERVER_GROUP.add(channel);
   }
   
   
@@ -71,6 +76,9 @@
    */
   public static Channel getServerChannel(int key) {
      ChannelId channelId = SERVER_ID_MAP.get(key);
      if (null == channelId) {
         return null;
      }
      Channel channel = SERVER_GROUP.find(channelId);
      return channel;
   }