Ejemplo n.º 1
0
        /// <summary>
        /// Aborts any web requests that are taking a suspiciously long amount of time.
        /// </summary>
        /// <param name="allRequests">Object containing the current state</param>
        private void TimeoutConnections(object state)
        {
            if (IsDownloading)
            {
                System.Diagnostics.Debug.WriteLine("TIMEOUT BEGINNING.");

                foreach (Feed feed in _allRequests.Keys)
                {
                    // If the feed has not yet been downloaded, then cancel its web request.
                    if (!Downloads.ContainsKey(feed))
                    {
                        _allRequests[feed].Abort();
                    }
                }

                System.Diagnostics.Debug.WriteLine("TIMEOUT ENDING.");
            }
        }