Microsoft.AspNetCore.Buffering.BufferingWriteStream.DisableBufferingAsync C# (CSharp) Méthode

DisableBufferingAsync() private méthode

private DisableBufferingAsync ( CancellationToken cancellationToken ) : Task
cancellationToken System.Threading.CancellationToken
Résultat Task
        internal Task DisableBufferingAsync(CancellationToken cancellationToken)
        {
            _isBuffering = false;
            if (_buffer.Length > 0)
            {
                return FlushAsync(cancellationToken);
            }
            return Task.FromResult(0);
        }

Usage Example

        // Flush and disable the buffer if anyone tries to call the SendFile feature.
        public async Task SendFileAsync(string path, long offset, long?length, CancellationToken cancellation)
        {
            await _bufferStream.DisableBufferingAsync(cancellation);

            await _originalSendFileFeature.SendFileAsync(path, offset, length, cancellation);
        }
All Usage Examples Of Microsoft.AspNetCore.Buffering.BufferingWriteStream::DisableBufferingAsync