示例#1
0
        public static void Add(int devId, EsProtocol value)
        {
            if (IsExist(devId))
            {
                _mList.Remove(devId);
            }

            lock (_mList)
            {
                _mList.Add(devId, value);
            }
        }
示例#2
0
        public static bool IsSocketConect(int devId, EsProtocol value)
        {
            var flag = false;

            if (IsExist(devId))
            {
                var protocl = Element(devId);

                if (protocl.AsyncSocketUserToken.ConnectSocket.RemoteEndPoint.ToString() == value.AsyncSocketUserToken.ConnectSocket.RemoteEndPoint.ToString())
                {
                    flag = true;
                }
            }

            return(flag);
        }