Esempio n. 1
0
 protected void SendMessages()
 {
     while (true)
     {
         var uri = (Uri)_queue.Take();
         if (null == uri)
         {
             return;
         }
         try
         {
             _light.Write(false);
             _messageSender.FetchURL(uri);
         }
         catch (ThreadAbortException)
         {
             throw;
         }
         catch (Exception ex)
         {
             Debug.Print("Couldn't fetch URL: " + uri.AbsoluteUri + ": " + ex.ToString());
         }
         finally
         {
             _light.Write(true);
             foreach (var wd in _resetWatchdogsOnSend)
             {
                 wd.Reset();
             }
         }
     }
 }