예제 #1
0
 private void _providerTimer_Elapsed(object sender, ElapsedEventArgs e)
 {
     if (_providerList.Count == 0)
     {
         Console.WriteLine("No Providers here");
     }
     else
     {
         foreach (var provider in _providerList)
         {
             provider.IsAlive = NetworkHelpers.CheckHostAlive(provider.IpAdress, 8024);
             if (!provider.IsAlive)
             {
                 RemoveProvider(provider, _providerList);
                 lock (sync)
                 {
                     foreach (var singleMonitor in provider.ProviderContent)
                     {
                         if (_catchersDictionary[singleMonitor.MonitorID].MonitorContent == null)
                         {
                             _catchersDictionary[singleMonitor.MonitorID] = singleMonitor;
                         }
                         else
                         {
                             SetContent(singleMonitor);
                         }
                         if (singleMonitor != null)
                         {
                             Task.Run(() =>
                             {
                                 InvokeSendEvent(GetSubscribers(singleMonitor), singleMonitor);
                             });
                         }
                     }
                 }
             }
         }
     }
 }