Beispiel #1
0
 // Triggered by request CancellationToken canceling or response stream Disposal.
 internal void ClientInitiatedAbort()
 {
     if (!_pipelineFinished)
     {
         // We don't want to trigger the token for already completed responses.
         _requestLifetimeFeature.Cancel();
     }
     // Writes will still succeed, the app will only get an error if they check the CT.
     _responseReaderStream.Abort(new IOException("The client aborted the request."));
 }
Beispiel #2
0
        // Triggered by request CancellationToken canceling or response stream Disposal.
        internal void ClientInitiatedAbort()
        {
            if (!_pipelineFinished)
            {
                // We don't want to trigger the token for already completed responses.
                _requestLifetimeFeature.Cancel();
            }

            // Writes will still succeed, the app will only get an error if they check the CT.
            _responseReaderStream.Abort(new IOException("The client aborted the request."));

            // Cancel any pending request async activity when the client aborts a duplex
            // streaming scenario by disposing the HttpResponseMessage.
            CancelRequestBody();
        }