public void CancelAsync() { myWebClient.CancelAsync(); if (anothersmallthreadpool != null) { anothersmallthreadpool.CancelWork(); } }
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; }