public static void Add(int devId, EsProtocol value) { if (IsExist(devId)) { _mList.Remove(devId); } lock (_mList) { _mList.Add(devId, value); } }
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); }