Esempio n. 1
0
 // Waits for incoming data messages to add to cache.
 protected override void ServiceTask()
 {
     if (Hub == null)
     {
         ProtocolCommands.Commander.Exchanges.TryGetValue(ExchangeName, out Hub);
     }
     if (Hub != null)
     {
         if (Hub.Exchange.IsClosingState())
         {
             Hub = null;
             OffsetTable.Clear();
         }
         else
         {
             BabelMessage b = Hub.GetMessageFromQueue(MessageId);
             if (b != null)
             {
                 if (OffsetTable.Count == 0)
                 {
                     ParameterManager.ProcessReadVarMessage(b, null, null, null, null, OffsetTable);
                 }
                 AddPoint(ParameterManager.ProcessReadVarMessageViaOffsets(b, OffsetTable));
                 return;
             }
         }
     }
     Thread.Sleep(1000);
 }
Esempio n. 2
0
 private void init()
 {
     CacheId      = (++ProtocolCommands.CacheIdCounter).ToString();
     Hub          = null;
     OffsetTable  = new List <long>();
     ExchangeName = "";
     MessageId    = 0;
 }