internal void ReadNextDownloadResult() { m_streamReadState = StreamReadState.Response; m_streamBytesNeeded = ResponseLen; m_streamBytesRead = 0; m_nextFileCompleteEventArgs = new DownloadFinishedEventArgs { Result = DownloadResult.Failure }; BeginReadHeader(); }
private void OnDownloadFinished(DownloadFinishedEventArgs e) { m_downloadQueue.Dequeue(); e.DownloadQueueLength = m_downloadQueue.Count; if (DownloadFinished != null) { DownloadFinished(this, e); } if (m_downloadQueue.Count > 0) { ReadNextDownloadResult(); } }
private void OnDownloadFinished(DownloadFinishedEventArgs e) { m_mutex.WaitOne(); m_downloadQueue.Dequeue(); int count = m_downloadQueue.Count; m_mutex.ReleaseMutex(); e.DownloadQueueLength = count; if (DownloadFinished != null) { DownloadFinished(this, e); } if (count > 0) { ReadNextDownloadResult(); } }