WoWHeadParser.Requests.EndGetResponse C# (CSharp) Method

EndGetResponse() public method

public EndGetResponse ( IAsyncResult asyncResult, string &page ) : bool
asyncResult IAsyncResult
page string
return bool
        public bool EndGetResponse(IAsyncResult asyncResult, out string page)
        {
            try
            {
                m_response = (HttpWebResponse)m_request.EndGetResponse(asyncResult);
                page = ToString();
                return true;
            }
            catch
            {
                page = string.Empty;
                Console.WriteLine(Resources.Error_Cannot_get_response, m_uri);
                return false;
            }
        }

Usage Example

Exemplo n.º 1
0
        private void RespCallback(IAsyncResult iar)
        {
            Requests request = (Requests)iar.AsyncState;

            string page;
            bool   success = request.EndGetResponse(iar, out page);

            lock (m_locker)
            {
                if (success)
                {
                    m_parser.TryParse(page, request.Id);
                }
                else if (m_storeUnprocessedIds)
                {
                    m_badIds.Enqueue(request.Id);
                }
            }
            request.Dispose();
            m_semaphore.Release();

            if (success && PageDownloadingComplete != null)
            {
                PageDownloadingComplete(null, EventArgs.Empty);
            }
        }
All Usage Examples Of WoWHeadParser.Requests::EndGetResponse