mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-07-05 22:47:59 +08:00
update 全局map
This commit is contained in:
@@ -3,13 +3,17 @@ package com.jsowell.common.enums.ykc;
|
|||||||
import io.netty.channel.Channel;
|
import io.netty.channel.Channel;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
import java.util.concurrent.ConcurrentHashMap;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 桩编号和channel的关联关系处理 entity
|
* 桩编号和channel的关联关系处理 entity
|
||||||
*/
|
*/
|
||||||
public class PileChannelEntity {
|
public class PileChannelEntity {
|
||||||
|
|
||||||
private static HashMap<String, Channel> manager = new HashMap<>();
|
/**
|
||||||
|
* 管理一个全局map,保存连接进服务端的通道数量
|
||||||
|
*/
|
||||||
|
private static final ConcurrentHashMap<String, Channel> manager = new ConcurrentHashMap<>();
|
||||||
|
|
||||||
public static void put(String pileSn, Channel channel) {
|
public static void put(String pileSn, Channel channel) {
|
||||||
manager.put(pileSn, channel);
|
manager.put(pileSn, channel);
|
||||||
|
|||||||
Reference in New Issue
Block a user