public void CancelAsync()
 {
     myWebClient.CancelAsync();
     if (anothersmallthreadpool != null)
     {
         anothersmallthreadpool.CancelWork();
     }
 }
Esempio n. 2
0
        public void StopListeningForDweets()
        {
            Log.Instance.Debug("Stop listening dweets");

            try
            {
                if (_webClient != null)
                {
                    _webClient.OpenReadCompleted -= WebClient_OpenReadCompleted;
                    _webClient.CancelAsync();
                }
            }
            catch (Exception e)
            {
                Log.Instance.Error(e);
            }

            _isListening = false;
        }