Example #1
0
 public MpanContainer AddOrReplace(NodeGroupId nodeGroupId, byte sequenceNumber, byte[] receiverGroupHandle, byte[] mpanState)
 {
     lock (_synchObject)
     {
         if (_table.ContainsKey(nodeGroupId))
         {
             _table.Remove(nodeGroupId);
         }
         var mpanContainer = new MpanContainer(nodeGroupId, mpanState, sequenceNumber, receiverGroupHandle);
         _table.Add(nodeGroupId, mpanContainer);
         return(mpanContainer);
     }
 }
Example #2
0
        public MpanContainer GetLatestContainerByOwnerId(byte ownerId)
        {
            MpanContainer ret = null;

            lock (_synchObject)
            {
                var record = _table.Where(item => item.Value.NodeGroupId.NodeId == ownerId)
                             .OrderByDescending(item => item.Value.ReceivedTimeStamp)
                             .FirstOrDefault();

                ret = record.Value;
            }
            return(ret);
        }