Exemplo n.º 1
0
        /// <summary>
        /// This method is the main loop for the spider threads.
        /// This method will wait for URL's to become available,
        /// and then process them.
        /// </summary>
        public void Process()
        {
            while (!m_spider.Quit)
            {
                m_uri = m_spider.ObtainWork();

                m_spider.SpiderDone.WorkerBegin();
                System.Console.WriteLine("Download(" + this.Number + "):" + m_uri);
                string page = GetPage();
                if (page != null)
                {
                    ProcessPage(page);
                }
                m_spider.SpiderDone.WorkerEnd();
            }
        }