WoWHeadParser.Requests.Dispose C# (CSharp) Method

Dispose() public method

public Dispose ( ) : void
return void
        public void Dispose()
        {
            if (m_request != null)
                m_request.Abort();
            if (m_response != null)
                m_response.Close();
        }

Usage Example

        private void RespCallback(IAsyncResult iar)
        {
            Requests request = (Requests)iar.AsyncState;

            try
            {
                request.Response = (HttpWebResponse)request.Request.EndGetResponse(iar);
                string text = request.ToString();
                if (!string.IsNullOrEmpty(text))
                {
                    Block block = new Block(text, request.Entry);
                    lock (_threadLock)
                        _pages.Enqueue(block);
                }
            }
            catch
            {
            }
            finally
            {
                request.Dispose();
            }

            _semaphore.Release();
            _background.ReportProgress(PercentProgress);
        }
All Usage Examples Of WoWHeadParser.Requests::Dispose