public void CancelPendingRequests()
{
CheckDisposed();
if (NetEventSource.IsEnabled) NetEventSource.Enter(this);
// With every request we link this cancellation token source.
CancellationTokenSource currentCts = Interlocked.Exchange(ref _pendingRequestsCts,
new CancellationTokenSource());
currentCts.Cancel();
currentCts.Dispose();
if (NetEventSource.IsEnabled) NetEventSource.Exit(this);
}