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