27 instantiations of FlushResult
Microsoft.AspNetCore.Server.Kestrel.Core (8)
Internal\Http\Http1OutputProducer.cs (4)
147return new ValueTask<FlushResult>(new FlushResult(false, true)); 502return new ValueTask<FlushResult>(new FlushResult(false, true)); 522return new ValueTask<FlushResult>(new FlushResult(false, true)); 560return new ValueTask<FlushResult>(new FlushResult(false, true));
Internal\Http2\Http2OutputProducer.cs (2)
274return new ValueTask<FlushResult>(new FlushResult(false, true)); 539return new ValueTask<FlushResult>(new FlushResult(false, true));
Internal\Http3\Http3OutputProducer.cs (2)
180return new ValueTask<FlushResult>(new FlushResult(false, true)); 368return new ValueTask<FlushResult>(new FlushResult(false, true));
Microsoft.AspNetCore.Server.Kestrel.Core.Tests (2)
ConcurrentPipeWriterTests.cs (1)
379pipeWriterFlushTcsArray[0].SetResult(new FlushResult(isCanceled: true, isCompleted: false));
HttpResponseStreamTests.cs (1)
114mockHttpResponseControl.Setup(m => m.WritePipeAsync(It.IsAny<ReadOnlyMemory<byte>>(), CancellationToken.None)).Returns(new ValueTask<FlushResult>(new FlushResult()));
Microsoft.AspNetCore.Server.Kestrel.Microbenchmarks (1)
Mocks\NullPipeWriter.cs (1)
30return new ValueTask<FlushResult>(new FlushResult(false, true));
Microsoft.AspNetCore.Server.Kestrel.Transport.Quic (2)
Internal\QuicStreamContext.cs (2)
240flushTask = ValueTask.FromResult(new FlushResult(isCanceled: false, isCompleted: true)); 312return new FlushResult(isCanceled: false, isCompleted: true);
Microsoft.AspNetCore.SignalR.Client.Core (2)
src\SignalR\common\Shared\MessageBuffer.cs (2)
60_completedTCS.SetResult(new()); 253FlushResult finalResult = new();
Microsoft.AspNetCore.SignalR.Core (4)
HubConnectionContext.cs (2)
292return new ValueTask<FlushResult>(new FlushResult(isCanceled: false, isCompleted: true)); 320return new ValueTask<FlushResult>(new FlushResult(isCanceled: false, isCompleted: true));
src\SignalR\common\Shared\MessageBuffer.cs (2)
60_completedTCS.SetResult(new()); 253FlushResult finalResult = new();
Microsoft.Extensions.Logging.Console (1)
src\libraries\Common\src\System\Text\Json\PooledByteBufferWriter.cs (1)
228return new FlushResult(isCanceled: false, isCompleted: false);
System.IO.Pipelines (6)
System\IO\Pipelines\Pipe.cs (1)
1061return new ValueTask<FlushResult>(new FlushResult(isCanceled: false, isCompleted: true));
System\IO\Pipelines\PipeReader.cs (2)
218return new ValueTask<FlushResult>(new FlushResult(isCanceled: false, isCompleted: false)); 224return new FlushResult(isCanceled: false, isCompleted: false);
System\IO\Pipelines\StreamPipeWriter.cs (3)
270return new ValueTask<FlushResult>(new FlushResult(isCanceled: false, isCompleted: false)); 353return new FlushResult(isCanceled: false, isCompleted: false); 367return new FlushResult(isCanceled: true, isCompleted: false);
System.Text.Json (1)
src\libraries\Common\src\System\Text\Json\PooledByteBufferWriter.cs (1)
228return new FlushResult(isCanceled: false, isCompleted: false);
315 references to FlushResult
ClientSample (1)
Tcp\TcpConnection.cs (1)
174var result = await _application.Output.FlushAsync();
http2cat (2)
src\Shared\ValueTaskExtensions\ValueTaskExtensions.cs (2)
13public static Task GetAsTask(this in ValueTask<FlushResult> valueTask) 29public static ValueTask GetAsValueTask(this in ValueTask<FlushResult> valueTask)
IIS.FunctionalTests (2)
src\Shared\ValueTaskExtensions\ValueTaskExtensions.cs (2)
13public static Task GetAsTask(this in ValueTask<FlushResult> valueTask) 29public static ValueTask GetAsValueTask(this in ValueTask<FlushResult> valueTask)
IIS.LongTests (2)
src\Shared\ValueTaskExtensions\ValueTaskExtensions.cs (2)
13public static Task GetAsTask(this in ValueTask<FlushResult> valueTask) 29public static ValueTask GetAsValueTask(this in ValueTask<FlushResult> valueTask)
IIS.NewHandler.FunctionalTests (2)
src\Shared\ValueTaskExtensions\ValueTaskExtensions.cs (2)
13public static Task GetAsTask(this in ValueTask<FlushResult> valueTask) 29public static ValueTask GetAsValueTask(this in ValueTask<FlushResult> valueTask)
IIS.NewShim.FunctionalTests (2)
src\Shared\ValueTaskExtensions\ValueTaskExtensions.cs (2)
13public static Task GetAsTask(this in ValueTask<FlushResult> valueTask) 29public static ValueTask GetAsValueTask(this in ValueTask<FlushResult> valueTask)
IIS.ShadowCopy.Tests (2)
src\Shared\ValueTaskExtensions\ValueTaskExtensions.cs (2)
13public static Task GetAsTask(this in ValueTask<FlushResult> valueTask) 29public static ValueTask GetAsValueTask(this in ValueTask<FlushResult> valueTask)
IISExpress.FunctionalTests (2)
src\Shared\ValueTaskExtensions\ValueTaskExtensions.cs (2)
13public static Task GetAsTask(this in ValueTask<FlushResult> valueTask) 29public static ValueTask GetAsValueTask(this in ValueTask<FlushResult> valueTask)
InMemory.FunctionalTests (18)
Http2\Http2StreamTests.cs (3)
4300var result = await httpContext.Response.BodyWriter.WriteAsync(payload); 4333var cancelledResult = await httpContext.Response.BodyWriter.WriteAsync(payload); 4337var goodResult = await httpContext.Response.BodyWriter.WriteAsync(secondPayload);
Http3\Http3StreamTests.cs (3)
768var result = await context.Response.BodyWriter.WriteAsync(payload); 799var cancelledResult = await context.Response.BodyWriter.WriteAsync(payload); 803var goodResult = await context.Response.BodyWriter.WriteAsync(secondPayload);
Http3\WebTransport\WebTransportTestUtilities.cs (6)
120public ValueTask<FlushResult> FlushPipeAsync(CancellationToken cancellationToken) 123return new ValueTask<FlushResult>(); 142public ValueTask<FlushResult> ProduceContinueAsync() 145return new ValueTask<FlushResult>(); 154public ValueTask<FlushResult> WritePipeAsync(ReadOnlyMemory<byte> source, CancellationToken cancellationToken) 157return new ValueTask<FlushResult>();
ResponseTests.cs (3)
223var result = await context.Response.BodyWriter.WriteAsync(payload); 250var cancelledResult = await context.Response.BodyWriter.WriteAsync(payload); 254var goodResult = await context.Response.BodyWriter.WriteAsync(secondPayload);
src\Servers\Kestrel\shared\CompletionPipeWriter.cs (2)
47public override ValueTask<FlushResult> WriteAsync(ReadOnlyMemory<byte> source, CancellationToken cancellationToken = default) 52public override ValueTask<FlushResult> FlushAsync(CancellationToken cancellationToken = default)
src\Servers\Kestrel\shared\test\PassThroughConnectionMiddleware.cs (1)
54public override ValueTask<FlushResult> FlushAsync(CancellationToken cancellationToken = default) => _output.FlushAsync(cancellationToken);
Interop.FunctionalTests (1)
Http3\Http3RequestTests.cs (1)
1198var flushResult = await context.Response.BodyWriter.FlushAsync();
Microsoft.AspNetCore.Grpc.JsonTranscoding (2)
src\Shared\ValueTaskExtensions\ValueTaskExtensions.cs (2)
13public static Task GetAsTask(this in ValueTask<FlushResult> valueTask) 29public static ValueTask GetAsValueTask(this in ValueTask<FlushResult> valueTask)
Microsoft.AspNetCore.Http (2)
src\Shared\ValueTaskExtensions\ValueTaskExtensions.cs (2)
13public static Task GetAsTask(this in ValueTask<FlushResult> valueTask) 29public static ValueTask GetAsValueTask(this in ValueTask<FlushResult> valueTask)
Microsoft.AspNetCore.Http.Abstractions (2)
src\Shared\ValueTaskExtensions\ValueTaskExtensions.cs (2)
13public static Task GetAsTask(this in ValueTask<FlushResult> valueTask) 29public static ValueTask GetAsValueTask(this in ValueTask<FlushResult> valueTask)
Microsoft.AspNetCore.Http.Connections (5)
Internal\Transports\WebSocketsServerTransport.cs (1)
163var flushResult = await _application.Output.FlushAsync();
src\Shared\ValueTaskExtensions\ValueTaskExtensions.cs (2)
13public static Task GetAsTask(this in ValueTask<FlushResult> valueTask) 29public static ValueTask GetAsValueTask(this in ValueTask<FlushResult> valueTask)
src\SignalR\common\Shared\PipeWriterStream.cs (2)
92static async ValueTask WriteSlowAsync(ValueTask<FlushResult> flushTask) 94var flushResult = await flushTask.ConfigureAwait(false);
Microsoft.AspNetCore.Http.Connections.Client (5)
Internal\LongPollingTransport.cs (1)
198var flushResult = await _application.Output.FlushAsync(cancellationToken).ConfigureAwait(false);
Internal\ServerSentEventsTransport.cs (1)
146var flushResult = await _application.Output.WriteAsync(item.Data, default).ConfigureAwait(false);
Internal\WebSocketsTransport.cs (1)
489var flushResult = await _application.Output.FlushAsync().ConfigureAwait(false);
src\SignalR\common\Shared\PipeWriterStream.cs (2)
92static async ValueTask WriteSlowAsync(ValueTask<FlushResult> flushTask) 94var flushResult = await flushTask.ConfigureAwait(false);
Microsoft.AspNetCore.Http.Connections.Tests (1)
HttpConnectionManagerTests.cs (1)
128var result = await connection.Transport.Output.FlushAsync();
Microsoft.AspNetCore.OutputCaching.Microbenchmarks (1)
EndToEndBenchmarks.cs (1)
284public override ValueTask<FlushResult> FlushAsync(CancellationToken cancellationToken = default) => default;
Microsoft.AspNetCore.Server.HttpSys.FunctionalTests (2)
src\Shared\ValueTaskExtensions\ValueTaskExtensions.cs (2)
13public static Task GetAsTask(this in ValueTask<FlushResult> valueTask) 29public static ValueTask GetAsValueTask(this in ValueTask<FlushResult> valueTask)
Microsoft.AspNetCore.Server.IIS (4)
Core\IISHttpContext.IO.cs (1)
125var result = await _bodyInputPipe.Writer.FlushAsync();
Core\OutputProducer.cs (1)
105private async Task FlushNowAsyncAwaited(ValueTask<FlushResult> awaitable, CancellationToken cancellationToken)
src\Shared\ValueTaskExtensions\ValueTaskExtensions.cs (2)
13public static Task GetAsTask(this in ValueTask<FlushResult> valueTask) 29public static ValueTask GetAsValueTask(this in ValueTask<FlushResult> valueTask)
Microsoft.AspNetCore.Server.Kestrel.Core (129)
Internal\Http\Http1OutputProducer.cs (17)
106public ValueTask<FlushResult> WriteDataToPipeAsync(ReadOnlySpan<byte> buffer, CancellationToken cancellationToken = default) 110return new ValueTask<FlushResult>(Task.FromCanceled<FlushResult>(cancellationToken)); 116public ValueTask<FlushResult> WriteStreamSuffixAsync() 118ValueTask<FlushResult> result = default; 141public ValueTask<FlushResult> FlushAsync(CancellationToken cancellationToken = default) 147return new ValueTask<FlushResult>(new FlushResult(false, true)); 171static ValueTask<FlushResult> FlushAsyncChunked(Http1OutputProducer producer, CancellationToken token) 295public ValueTask<FlushResult> WriteChunkAsync(ReadOnlySpan<byte> buffer, CancellationToken cancellationToken) 489public ValueTask<FlushResult> Write100ContinueAsync() 494public ValueTask<FlushResult> FirstWriteAsync(int statusCode, string? reasonPhrase, HttpResponseHeaders responseHeaders, bool autoChunk, ReadOnlySpan<byte> buffer, CancellationToken cancellationToken) 502return new ValueTask<FlushResult>(new FlushResult(false, true)); 514public ValueTask<FlushResult> FirstWriteChunkedAsync(int statusCode, string? reasonPhrase, HttpResponseHeaders responseHeaders, bool autoChunk, ReadOnlySpan<byte> buffer, CancellationToken cancellationToken) 522return new ValueTask<FlushResult>(new FlushResult(false, true)); 550private ValueTask<FlushResult> WriteAsync( 560return new ValueTask<FlushResult>(new FlushResult(false, true)); 568private ValueTask<FlushResult> WriteAsyncInternal(
Internal\Http\HttpProtocol.cs (9)
935public ValueTask<FlushResult> ProduceContinueAsync() 1100private async Task WriteSuffixAwaited(ValueTask<FlushResult> writeTask) 1501public ValueTask<FlushResult> FlushPipeAsync(CancellationToken cancellationToken) 1582public ValueTask<FlushResult> WritePipeAsync(ReadOnlyMemory<byte> data, CancellationToken cancellationToken) 1618private ValueTask<FlushResult> FirstWriteAsync(ReadOnlyMemory<byte> data, CancellationToken cancellationToken) 1631private async ValueTask<FlushResult> FirstWriteAsyncAwaited(Task initializeTask, ReadOnlyMemory<byte> data, CancellationToken cancellationToken) 1638private ValueTask<FlushResult> FirstWriteAsyncInternal(ReadOnlyMemory<byte> data, CancellationToken cancellationToken) 1674private async ValueTask<FlushResult> FlushAsyncAwaited(Task initializeTask, CancellationToken cancellationToken) 1685public async ValueTask<FlushResult> WriteAsyncAwaited(Task initializeTask, ReadOnlyMemory<byte> data, CancellationToken cancellationToken)
Internal\Http\HttpResponsePipeWriter.cs (2)
46public override ValueTask<FlushResult> FlushAsync(CancellationToken cancellationToken = default) 64public override ValueTask<FlushResult> WriteAsync(ReadOnlyMemory<byte> source, CancellationToken cancellationToken = default)
Internal\Http\IHttpOutputProducer.cs (7)
13ValueTask<FlushResult> WriteChunkAsync(ReadOnlySpan<byte> data, CancellationToken cancellationToken); 14ValueTask<FlushResult> FlushAsync(CancellationToken cancellationToken); 15ValueTask<FlushResult> Write100ContinueAsync(); 18ValueTask<FlushResult> WriteDataToPipeAsync(ReadOnlySpan<byte> data, CancellationToken cancellationToken); 21ValueTask<FlushResult> WriteStreamSuffixAsync(); 28ValueTask<FlushResult> FirstWriteAsync(int statusCode, string? reasonPhrase, HttpResponseHeaders responseHeaders, bool autoChunk, ReadOnlySpan<byte> data, CancellationToken cancellationToken); 29ValueTask<FlushResult> FirstWriteChunkedAsync(int statusCode, string? reasonPhrase, HttpResponseHeaders responseHeaders, bool autoChunk, ReadOnlySpan<byte> data, CancellationToken cancellationToken);
Internal\Http\IHttpResponseControl.cs (3)
10ValueTask<FlushResult> ProduceContinueAsync(); 15ValueTask<FlushResult> FlushPipeAsync(CancellationToken cancellationToken); 16ValueTask<FlushResult> WritePipeAsync(ReadOnlyMemory<byte> source, CancellationToken cancellationToken);
Internal\Http\IHttpResponsePipeWriterControl.cs (2)
14ValueTask<FlushResult> FlushPipeAsync(CancellationToken cancellationToken); 15ValueTask<FlushResult> WritePipeAsync(ReadOnlyMemory<byte> source, CancellationToken cancellationToken);
Internal\Http\MessageBody.cs (3)
108protected ValueTask<FlushResult> TryProduceContinueAsync() 207ValueTask<FlushResult> continueTask = TryProduceContinueAsync(); 227protected async ValueTask<ReadResult> StartTimingReadAwaited(ValueTask<FlushResult> continueTask, ValueTask<ReadResult> readAwaitable, CancellationToken cancellationToken)
Internal\Http2\Http2Connection.cs (1)
1874var result = await writer.FlushAsync();
Internal\Http2\Http2FrameWriter.cs (17)
238FlushResult flushResult = default; 481private ValueTask<FlushResult> FlushEndOfStreamHeadersAsync(Http2Stream stream) 499public ValueTask<FlushResult> Write100ContinueAsync(int streamId) 563private ValueTask<FlushResult> WriteDataAndTrailersAsync(Http2Stream stream, in ReadOnlySequence<byte> data, bool writeHeaders, HttpResponseTrailers headers) 781private ValueTask<FlushResult> WriteDataAsync(Http2Stream stream, ReadOnlySequence<byte> data, long dataLength, bool endStream, bool writeHeaders) 783var writeTask = default(ValueTask<FlushResult>); 789return ValueTask.FromResult<FlushResult>(default); 830static async ValueTask<FlushResult> FlushAsyncAwaited(ValueTask<FlushResult> writeTask, ITimeoutControl timeoutControl, MinDataRate? minResponseDataRate) 837var flushResult = await writeTask; 852public ValueTask<FlushResult> WriteWindowUpdateAsync(int streamId, int sizeIncrement) 875public ValueTask<FlushResult> WriteRstStreamAsync(int streamId, Http2ErrorCode errorCode) 902public ValueTask<FlushResult> WriteSettingsAsync(List<Http2PeerSetting> settings) 935public ValueTask<FlushResult> WriteSettingsAckAsync() 957public ValueTask<FlushResult> WritePingAsync(Http2PingFrameFlags flags, in ReadOnlySequence<byte> payload) 987public ValueTask<FlushResult> WriteGoAwayAsync(int lastStreamId, Http2ErrorCode errorCode) 1045private ValueTask<FlushResult> TimeFlushUnsynchronizedAsync()
Internal\Http2\Http2MessageBody.cs (1)
49ValueTask<FlushResult> continueTask = TryProduceContinueAsync();
Internal\Http2\Http2OutputProducer.cs (18)
261public ValueTask<FlushResult> FlushAsync(CancellationToken cancellationToken) 265return new ValueTask<FlushResult>(Task.FromCanceled<FlushResult>(cancellationToken)); 274return new ValueTask<FlushResult>(new FlushResult(false, true)); 346public ValueTask<FlushResult> Write100ContinueAsync() 420public ValueTask<FlushResult> WriteStreamSuffixAsync() 426return ValueTask.FromResult<FlushResult>(default); 438return ValueTask.FromResult<FlushResult>(default); 442public ValueTask<FlushResult> WriteRstStreamAsync(Http2ErrorCode error) 524public ValueTask<FlushResult> WriteDataToPipeAsync(ReadOnlySpan<byte> data, CancellationToken cancellationToken) 528return new ValueTask<FlushResult>(Task.FromCanceled<FlushResult>(cancellationToken)); 539return new ValueTask<FlushResult>(new FlushResult(false, true)); 555public ValueTask<FlushResult> FirstWriteAsync(int statusCode, string? reasonPhrase, HttpResponseHeaders responseHeaders, bool autoChunk, ReadOnlySpan<byte> data, CancellationToken cancellationToken) 565ValueTask<FlushResult> IHttpOutputProducer.WriteChunkAsync(ReadOnlySpan<byte> data, CancellationToken cancellationToken) 570public ValueTask<FlushResult> FirstWriteChunkedAsync(int statusCode, string? reasonPhrase, HttpResponseHeaders responseHeaders, bool autoChunk, ReadOnlySpan<byte> data, CancellationToken cancellationToken) 626internal ValueTask<FlushResult> CompleteResponseAsync() 629ValueTask<FlushResult> task = default;
Internal\Http3\Http3Connection.cs (1)
745private async ValueTask<FlushResult> SendGoAwayAsync(long id)
Internal\Http3\Http3ControlStream.cs (1)
142internal ValueTask<FlushResult> SendGoAway(long id)
Internal\Http3\Http3FrameWriter.cs (6)
160public ValueTask<FlushResult> WriteDataAsync(in ReadOnlySequence<byte> data) 237internal ValueTask<FlushResult> WriteGoAway(long id) 262public ValueTask<FlushResult> Write100ContinueAsync() 296public ValueTask<FlushResult> WriteResponseTrailersAsync(long streamId, HttpResponseTrailers headers) 329private ValueTask<FlushResult> TimeFlushUnsynchronizedAsync() 337public ValueTask<FlushResult> FlushAsync(IHttpOutputAborter? outputAborter, CancellationToken cancellationToken)
Internal\Http3\Http3OutputProducer.cs (16)
28private ValueTask<FlushResult> _dataWriteProcessingTask; 152public ValueTask<FlushResult> FirstWriteAsync(int statusCode, string? reasonPhrase, HttpResponseHeaders responseHeaders, bool autoChunk, ReadOnlySpan<byte> data, CancellationToken cancellationToken) 162public ValueTask<FlushResult> FirstWriteChunkedAsync(int statusCode, string? reasonPhrase, HttpResponseHeaders responseHeaders, bool autoChunk, ReadOnlySpan<byte> data, CancellationToken cancellationToken) 167public ValueTask<FlushResult> FlushAsync(CancellationToken cancellationToken) 171return new ValueTask<FlushResult>(Task.FromCanceled<FlushResult>(cancellationToken)); 180return new ValueTask<FlushResult>(new FlushResult(false, true)); 308public ValueTask<FlushResult> Write100ContinueAsync() 323public ValueTask<FlushResult> WriteChunkAsync(ReadOnlySpan<byte> data, CancellationToken cancellationToken) 353public ValueTask<FlushResult> WriteDataToPipeAsync(ReadOnlySpan<byte> data, CancellationToken cancellationToken) 357return new ValueTask<FlushResult>(Task.FromCanceled<FlushResult>(cancellationToken)); 368return new ValueTask<FlushResult>(new FlushResult(false, true)); 395public ValueTask<FlushResult> WriteStreamSuffixAsync() 412private async ValueTask<FlushResult> ProcessDataWrites() 414FlushResult flushResult = default;
Internal\Infrastructure\PipeWriterHelpers\ConcurrentPipeWriter.cs (9)
44private TaskCompletionSource<FlushResult>? _currentFlushTcs; 109public override ValueTask<FlushResult> FlushAsync(CancellationToken cancellationToken = default) 113return new ValueTask<FlushResult>(_currentFlushTcs.Task); 134_currentFlushTcs = new TaskCompletionSource<FlushResult>(TaskCreationOptions.RunContinuationsAsynchronously); 135var result = new ValueTask<FlushResult>(_currentFlushTcs.Task); 143private async Task FlushAsyncAwaited(ValueTask<FlushResult> flushTask, CancellationToken cancellationToken) 151var flushResult = await flushTask; 168_currentFlushTcs = new TaskCompletionSource<FlushResult>(TaskCreationOptions.RunContinuationsAsynchronously); 288private void CompleteFlushUnsynchronized(FlushResult flushResult, Exception? flushEx)
Internal\Infrastructure\PipeWriterHelpers\TimingPipeFlusher.cs (9)
36public ValueTask<FlushResult> FlushAsync() 41public ValueTask<FlushResult> FlushAsync(IHttpOutputAborter? outputAborter, CancellationToken cancellationToken) 46public ValueTask<FlushResult> FlushAsync(MinDataRate? minRate, long count) 51public ValueTask<FlushResult> FlushAsync(MinDataRate? minRate, long count, IHttpOutputAborter? outputAborter, CancellationToken cancellationToken) 64var flushResult = pipeFlushTask.Result; 71return new ValueTask<FlushResult>(flushResult); 77private async ValueTask<FlushResult> TimeFlushAsyncAwaited(ValueTask<FlushResult> pipeFlushTask, MinDataRate? minRate, IHttpOutputAborter? outputAborter, CancellationToken cancellationToken) 86var flushResult = await pipeFlushTask;
Internal\Infrastructure\StatusCheckPipeWriter.cs (2)
58public override ValueTask<FlushResult> FlushAsync(CancellationToken cancellationToken = default) 88public override ValueTask<FlushResult> WriteAsync(ReadOnlyMemory<byte> source, CancellationToken cancellationToken = default)
Internal\Infrastructure\ThrowingPipeWriter.cs (1)
23public override ValueTask<FlushResult> FlushAsync(CancellationToken cancellationToken = default) => throw new InvalidOperationException(_message);
Internal\Infrastructure\WrappingPipeWriter.cs (2)
41public override ValueTask<FlushResult> FlushAsync(CancellationToken cancellationToken = default) 66public override ValueTask<FlushResult> WriteAsync(ReadOnlyMemory<byte> source, CancellationToken cancellationToken = default)
src\Shared\ValueTaskExtensions\ValueTaskExtensions.cs (2)
13public static Task GetAsTask(this in ValueTask<FlushResult> valueTask) 29public static ValueTask GetAsValueTask(this in ValueTask<FlushResult> valueTask)
Microsoft.AspNetCore.Server.Kestrel.Core.Tests (28)
ConcurrentPipeWriterTests.cs (24)
24new TaskCompletionSource<FlushResult>(TaskCreationOptions.RunContinuationsAsynchronously), 25new TaskCompletionSource<FlushResult>(TaskCreationOptions.RunContinuationsAsynchronously), 32ValueTask<FlushResult> flushTask; 87new TaskCompletionSource<FlushResult>(TaskCreationOptions.RunContinuationsAsynchronously), 88new TaskCompletionSource<FlushResult>(TaskCreationOptions.RunContinuationsAsynchronously), 89new TaskCompletionSource<FlushResult>(TaskCreationOptions.RunContinuationsAsynchronously), 95var flushTask0 = default(ValueTask<FlushResult>); 96var flushTask1 = default(ValueTask<FlushResult>); 185new TaskCompletionSource<FlushResult>(TaskCreationOptions.RunContinuationsAsynchronously), 186new TaskCompletionSource<FlushResult>(TaskCreationOptions.RunContinuationsAsynchronously), 193var flushTask0 = default(ValueTask<FlushResult>); 194var flushTask1 = default(ValueTask<FlushResult>); 269new TaskCompletionSource<FlushResult>(TaskCreationOptions.RunContinuationsAsynchronously), 270new TaskCompletionSource<FlushResult>(TaskCreationOptions.RunContinuationsAsynchronously), 277var flushTask0 = default(ValueTask<FlushResult>); 337new TaskCompletionSource<FlushResult>(TaskCreationOptions.RunContinuationsAsynchronously), 338new TaskCompletionSource<FlushResult>(TaskCreationOptions.RunContinuationsAsynchronously), 344var flushTask0 = default(ValueTask<FlushResult>); 345var flushTask1 = default(ValueTask<FlushResult>); 346var flushTask2 = default(ValueTask<FlushResult>); 418private readonly TaskCompletionSource<FlushResult>[] _flushResults; 420public MockPipeWriter(TaskCompletionSource<FlushResult>[] flushResults) 434public override ValueTask<FlushResult> FlushAsync(CancellationToken cancellationToken = default) 438return new ValueTask<FlushResult>(_flushResults[FlushCallCount - 1].Task);
Http1\Http1ConnectionTests.cs (2)
720var successResult = await writer.WriteAsync(payload); 734var successResult = await writer.WriteAsync(payload);
HttpResponseStreamTests.cs (1)
114mockHttpResponseControl.Setup(m => m.WritePipeAsync(It.IsAny<ReadOnlyMemory<byte>>(), CancellationToken.None)).Returns(new ValueTask<FlushResult>(new FlushResult()));
src\Servers\Kestrel\shared\test\PassThroughConnectionMiddleware.cs (1)
54public override ValueTask<FlushResult> FlushAsync(CancellationToken cancellationToken = default) => _output.FlushAsync(cancellationToken);
Microsoft.AspNetCore.Server.Kestrel.Microbenchmarks (6)
InMemoryTransportBenchmark.cs (1)
186public ValueTask<FlushResult> SendRequestAsync(byte[] request)
Mocks\NullPipeWriter.cs (2)
28public override ValueTask<FlushResult> FlushAsync(CancellationToken cancellationToken = default) 30return new ValueTask<FlushResult>(new FlushResult(false, true));
ResponseHeadersWritingBenchmark.cs (1)
206public override ValueTask<FlushResult> FlushAsync(CancellationToken cancellationToken = default) => default;
src\Servers\Kestrel\shared\CompletionPipeWriter.cs (2)
47public override ValueTask<FlushResult> WriteAsync(ReadOnlyMemory<byte> source, CancellationToken cancellationToken = default) 52public override ValueTask<FlushResult> FlushAsync(CancellationToken cancellationToken = default)
Microsoft.AspNetCore.Server.Kestrel.Transport.NamedPipes (1)
Internal\NamedPipeConnection.cs (1)
108var result = await flushTask;
Microsoft.AspNetCore.Server.Kestrel.Transport.Quic (5)
Internal\QuicStreamContext.cs (3)
224ValueTask<FlushResult> flushTask; 259var result = await flushTask; 309async static ValueTask<FlushResult> AwaitCompleteTaskAsync(ValueTask completeTask)
src\Servers\Kestrel\shared\CompletionPipeWriter.cs (2)
47public override ValueTask<FlushResult> WriteAsync(ReadOnlyMemory<byte> source, CancellationToken cancellationToken = default) 52public override ValueTask<FlushResult> FlushAsync(CancellationToken cancellationToken = default)
Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets (1)
Internal\SocketConnection.cs (1)
181var result = await flushTask;
Microsoft.AspNetCore.Shared.Tests (2)
src\Shared\ValueTaskExtensions\ValueTaskExtensions.cs (2)
13public static Task GetAsTask(this in ValueTask<FlushResult> valueTask) 29public static ValueTask GetAsValueTask(this in ValueTask<FlushResult> valueTask)
Microsoft.AspNetCore.SignalR.Client.Core (15)
HubConnection.cs (2)
1489var sendHandshakeResult = await startingConnectionState.Connection.Transport.Output.FlushAsync(CancellationToken.None).ConfigureAwait(false); 2291public ValueTask<FlushResult> WriteAsync(HubMessage message, CancellationToken cancellationToken)
src\Shared\ValueTaskExtensions\ValueTaskExtensions.cs (2)
13public static Task GetAsTask(this in ValueTask<FlushResult> valueTask) 29public static ValueTask GetAsValueTask(this in ValueTask<FlushResult> valueTask)
src\SignalR\common\Shared\MessageBuffer.cs (9)
21private static readonly TaskCompletionSource<FlushResult> _completedTCS = new TaskCompletionSource<FlushResult>(); 50private TaskCompletionSource<FlushResult> _resend = _completedTCS; 122public ValueTask<FlushResult> WriteAsync(SerializedHubMessage hubMessage, CancellationToken cancellationToken) 127public ValueTask<FlushResult> WriteAsync(HubMessage hubMessage, CancellationToken cancellationToken) 132private async ValueTask<FlushResult> WriteAsyncCore(HubMessage hubMessage, ReadOnlyMemory<byte> messageBytes, CancellationToken cancellationToken) 156ValueTask<FlushResult> writeTask; 250var tcs = new TaskCompletionSource<FlushResult>(TaskCreationOptions.RunContinuationsAsynchronously); 253FlushResult finalResult = new();
src\SignalR\common\Shared\PipeWriterStream.cs (2)
92static async ValueTask WriteSlowAsync(ValueTask<FlushResult> flushTask) 94var flushResult = await flushTask.ConfigureAwait(false);
Microsoft.AspNetCore.SignalR.Core (14)
HubConnectionContext.cs (5)
268private ValueTask<FlushResult> WriteCore(HubMessage message, CancellationToken cancellationToken) 292return new ValueTask<FlushResult>(new FlushResult(isCanceled: false, isCompleted: true)); 296private ValueTask<FlushResult> WriteCore(SerializedHubMessage message, CancellationToken cancellationToken) 320return new ValueTask<FlushResult>(new FlushResult(isCanceled: false, isCompleted: true)); 324private async Task CompleteWriteAsync(ValueTask<FlushResult> task)
src\SignalR\common\Shared\MessageBuffer.cs (9)
21private static readonly TaskCompletionSource<FlushResult> _completedTCS = new TaskCompletionSource<FlushResult>(); 50private TaskCompletionSource<FlushResult> _resend = _completedTCS; 122public ValueTask<FlushResult> WriteAsync(SerializedHubMessage hubMessage, CancellationToken cancellationToken) 127public ValueTask<FlushResult> WriteAsync(HubMessage hubMessage, CancellationToken cancellationToken) 132private async ValueTask<FlushResult> WriteAsyncCore(HubMessage hubMessage, ReadOnlyMemory<byte> messageBytes, CancellationToken cancellationToken) 156ValueTask<FlushResult> writeTask; 250var tcs = new TaskCompletionSource<FlushResult>(TaskCreationOptions.RunContinuationsAsynchronously); 253FlushResult finalResult = new();
Microsoft.AspNetCore.SignalR.Microbenchmarks (3)
Shared\TestPipeWriter.cs (3)
39public override ValueTask<FlushResult> FlushAsync(CancellationToken cancellationToken = new CancellationToken()) 46return new ValueTask<FlushResult>(ForceAsyncResult()); 49public async Task<FlushResult> ForceAsyncResult()
Microsoft.AspNetCore.TestHost (1)
ResponseBodyPipeWriter.cs (1)
24public override async ValueTask<FlushResult> FlushAsync(CancellationToken cancellationToken)
Microsoft.Extensions.Logging.Console (1)
src\libraries\Common\src\System\Text\Json\PooledByteBufferWriter.cs (1)
217public override async ValueTask<FlushResult> FlushAsync(CancellationToken cancellationToken = default)
PlaintextApp (1)
Startup.cs (1)
58public static Task GetAsTask(this in ValueTask<FlushResult> valueTask)
Sockets.FunctionalTests (2)
src\Servers\Kestrel\shared\test\PassThroughConnectionMiddleware.cs (1)
54public override ValueTask<FlushResult> FlushAsync(CancellationToken cancellationToken = default) => _output.FlushAsync(cancellationToken);
src\Servers\Kestrel\test\FunctionalTests\ConnectionMiddlewareTests.cs (1)
152public override ValueTask<FlushResult> FlushAsync(CancellationToken cancellationToken = default)
System.IO.Pipelines (45)
System\IO\Pipelines\FlushResult.cs (4)
11/// <summary>Initializes a new instance of <see cref="System.IO.Pipelines.FlushResult" /> struct setting the <see cref="System.IO.Pipelines.FlushResult.IsCanceled" /> and <see cref="System.IO.Pipelines.FlushResult.IsCompleted" /> flags.</summary> 12/// <param name="isCanceled"><see langword="true" /> to indicate the current <see cref="System.IO.Pipelines.PipeWriter.FlushAsync(System.Threading.CancellationToken)" /> operation that produced this <see cref="System.IO.Pipelines.FlushResult" /> was canceled by <see cref="System.IO.Pipelines.PipeWriter.CancelPendingFlush" />; otherwise, <see langword="false" />.</param>
System\IO\Pipelines\Pipe.cs (16)
363internal ValueTask<FlushResult> FlushAsync(CancellationToken cancellationToken) 367return new ValueTask<FlushResult>(Task.FromCanceled<FlushResult>(cancellationToken)); 371ValueTask<FlushResult> result; 382private void PrepareFlushUnsynchronized(out CompletionData completionData, out ValueTask<FlushResult> result, CancellationToken cancellationToken) 392FlushResult flushResult = default; 394result = new ValueTask<FlushResult>(flushResult); 399result = new ValueTask<FlushResult>(_writer, token: 0); 1008internal FlushResult GetFlushAsyncResult() 1010FlushResult result = default; 1039private void GetFlushResult(ref FlushResult result) 1052internal ValueTask<FlushResult> WriteAsync(ReadOnlyMemory<byte> source, CancellationToken cancellationToken) 1061return new ValueTask<FlushResult>(new FlushResult(isCanceled: false, isCompleted: true)); 1066return new ValueTask<FlushResult>(Task.FromCanceled<FlushResult>(cancellationToken)); 1070ValueTask<FlushResult> result;
System\IO\Pipelines\Pipe.DefaultPipeWriter.cs (4)
13private sealed class DefaultPipeWriter : PipeWriter, IValueTaskSource<FlushResult> 32public override ValueTask<FlushResult> FlushAsync(CancellationToken cancellationToken = default) => _pipe.FlushAsync(cancellationToken); 42public FlushResult GetResult(short token) => _pipe.GetFlushAsyncResult(); 48public override ValueTask<FlushResult> WriteAsync(ReadOnlyMemory<byte> source, CancellationToken cancellationToken = default)
System\IO\Pipelines\PipeReader.cs (4)
218return new ValueTask<FlushResult>(new FlushResult(isCanceled: false, isCompleted: false)); 221static async ValueTask<FlushResult> Awaited(ValueTask writeTask) 232private async Task CopyToAsyncCore<TStream>(TStream destination, Func<TStream, ReadOnlyMemory<byte>, CancellationToken, ValueTask<FlushResult>> writeAsync, CancellationToken cancellationToken) 258FlushResult flushResult = await writeAsync(destination, memory, cancellationToken).ConfigureAwait(false);
System\IO\Pipelines\PipeWriter.cs (5)
36/// <remarks>The canceled <see cref="System.IO.Pipelines.PipeWriter.FlushAsync(System.Threading.CancellationToken)" /> or <see cref="System.IO.Pipelines.PipeWriter.WriteAsync(System.ReadOnlyMemory{byte},System.Threading.CancellationToken)" /> operation returns a <see cref="System.IO.Pipelines.FlushResult" /> where <see cref="System.IO.Pipelines.FlushResult.IsCanceled" /> is <see langword="true" />.</remarks> 59public abstract ValueTask<FlushResult> FlushAsync(CancellationToken cancellationToken = default); 113public virtual ValueTask<FlushResult> WriteAsync(ReadOnlyMemory<byte> source, CancellationToken cancellationToken = default) 137FlushResult result = await FlushAsync(cancellationToken).ConfigureAwait(false);
System\IO\Pipelines\PipeWriterStream.cs (7)
79ValueTask<FlushResult> valueTask = _pipeWriter.WriteAsync(new ReadOnlyMemory<byte>(buffer, offset, count), cancellationToken); 87ValueTask<FlushResult> valueTask = _pipeWriter.WriteAsync(buffer, cancellationToken); 95ValueTask<FlushResult> valueTask = _pipeWriter.FlushAsync(cancellationToken); 100private static Task GetFlushResultAsTask(ValueTask<FlushResult> valueTask) 104FlushResult result = valueTask.Result; 113static async Task AwaitTask(ValueTask<FlushResult> valueTask) 115FlushResult result = await valueTask.ConfigureAwait(false);
System\IO\Pipelines\StreamPipeReader.cs (1)
339FlushResult flushResult = await destination.WriteAsync(segment.Memory.Slice(segmentIndex), tokenSource.Token).ConfigureAwait(false);
System\IO\Pipelines\StreamPipeWriter.cs (4)
266public override ValueTask<FlushResult> FlushAsync(CancellationToken cancellationToken = default) 270return new ValueTask<FlushResult>(new FlushResult(isCanceled: false, isCompleted: false)); 279public override ValueTask<FlushResult> WriteAsync(ReadOnlyMemory<byte> source, CancellationToken cancellationToken = default) 292private async ValueTask<FlushResult> FlushAsyncInternal(bool writeToStream, ReadOnlyMemory<byte> data, CancellationToken cancellationToken = default)
System.Text.Json (3)
src\libraries\Common\src\System\Text\Json\PooledByteBufferWriter.cs (1)
217public override async ValueTask<FlushResult> FlushAsync(CancellationToken cancellationToken = default)
System\Text\Json\Serialization\Metadata\JsonTypeInfoOfT.WriteHelpers.cs (2)
120FlushResult result = await pipeWriter.FlushAsync(cancellationToken).ConfigureAwait(false); 182FlushResult result = await pipeWriter.FlushAsync(cancellationToken).ConfigureAwait(false);