26 instantiations of ReadResult
InMemory.FunctionalTests (2)
Http3\WebTransport\WebTransportTestUtilities.cs (2)
193return new ValueTask<ReadResult>(new ReadResult( 199result = new ReadResult(new ReadOnlySequence<byte>((ReadOnlyMemory<byte>)_sharedMemory), false, true);
Microsoft.AspNetCore.Server.Kestrel.Core (7)
Internal\Http\Http1ContentLengthMessageBody.cs (5)
39return new ReadResult(_readResult.Buffer, Interlocked.Exchange(ref _userCanceled, 0) == 1, isCompleted: true); 126readResult = new ReadResult(_readResult.Buffer, Interlocked.Exchange(ref _userCanceled, 0) == 1, isCompleted: true); 196_readResult = new ReadResult( 221_readResult = new ReadResult(new ReadOnlySequence<byte>(), isCanceled: false, isCompleted: true); 230_readResult = new ReadResult(buffer, isCanceled: false, isCompleted: true);
Internal\Http\ZeroContentLengthMessageBody.cs (2)
18public override ValueTask<ReadResult> ReadAsync(CancellationToken cancellationToken = default) => new ValueTask<ReadResult>(new ReadResult(default, isCanceled: false, isCompleted: true)); 28result = new ReadResult(default, isCanceled: false, isCompleted: true);
Microsoft.AspNetCore.Server.Kestrel.Core.Tests (1)
HttpRequestStreamTests.cs (1)
112mockMessageBody.Setup(m => m.ReadAsync(CancellationToken.None)).Returns(new ValueTask<ReadResult>(new ReadResult(default, isCanceled: false, isCompleted: true)));
Microsoft.AspNetCore.SignalR.Microbenchmarks (9)
HubConnectionContextBenchmark.cs (1)
32_handshakeRequestResult = new ReadResult(new ReadOnlySequence<byte>(memoryBufferWriter.ToArray()), false, false);
HubConnectionReceiveBenchmark.cs (4)
47var handshakeResponseResult = new ReadResult(new ReadOnlySequence<byte>(writer.ToArray()), false, false); 126_nextReadTcs.SetResult(new ReadResult(default, false, true)); 137_pipe.AddReadResult(new ValueTask<ReadResult>(new ReadResult(new ReadOnlySequence<byte>(_invocationMessageBytes), false, false))); 154_tcs.SetResult(new ReadResult(new ReadOnlySequence<byte>(_invocationMessageBytes), false, false));
HubConnectionSendBenchmark.cs (2)
32var handshakeResponseResult = new ReadResult(new ReadOnlySequence<byte>(writer.ToArray()), false, false); 86_tcs.SetResult(new ReadResult(default, false, true));
HubConnectionStartBenchmark.cs (1)
31_handshakeResponseResult = new ReadResult(new ReadOnlySequence<byte>(writer.ToArray()), false, false);
Shared\TestPipeReader.cs (1)
39return new ValueTask<ReadResult>(new ReadResult(default, false, true));
System.IO.Pipelines (7)
System\IO\Pipelines\Pipe.cs (2)
974result = new ReadResult(readOnlySequence, isCanceled, isCompleted); 978result = new ReadResult(default, isCanceled, isCompleted);
System\IO\Pipelines\SequencePipeReader.cs (2)
69result = new ReadResult(ReadOnlySequence<byte>.Empty, isCanceled: false, isCompleted: true); 81result = new ReadResult(_sequence, isCancellationRequested, isCompleted: true);
System\IO\Pipelines\StreamPipeReader.cs (3)
236ReadResult completedResult = new ReadResult(buffer: default, isCanceled: false, isCompleted: true); 305return new ReadResult(reader.GetCurrentReadOnlySequence(), isCanceled, reader._isStreamCompleted); 477result = new ReadResult(buffer, isCancellationRequested, _isStreamCompleted);
365 references to ReadResult
Aspire.Dashboard (2)
Otlp\Http\OtlpHttpEndpointsBuilder.cs (2)
179ReadResult result = default; 213if (!result.Equals(default(ReadResult)))
Aspire.Hosting (1)
Dcp\DcpHostService.cs (1)
354var result = await reader.ReadAsync(CancellationToken.None).ConfigureAwait(false);
ClientSample (2)
RawSample.cs (1)
79var result = await input.ReadAsync();
Tcp\TcpConnection.cs (1)
221var result = await _application.Input.ReadAsync();
http2cat (1)
src\Shared\ServerInfrastructure\DuplexPipeStream.cs (1)
121var result = await _input.ReadAsync(cancellationToken);
IIS.FunctionalTests (1)
src\Shared\ServerInfrastructure\DuplexPipeStream.cs (1)
121var result = await _input.ReadAsync(cancellationToken);
IIS.LongTests (1)
src\Shared\ServerInfrastructure\DuplexPipeStream.cs (1)
121var result = await _input.ReadAsync(cancellationToken);
IIS.NewHandler.FunctionalTests (1)
src\Shared\ServerInfrastructure\DuplexPipeStream.cs (1)
121var result = await _input.ReadAsync(cancellationToken);
IIS.NewShim.FunctionalTests (1)
src\Shared\ServerInfrastructure\DuplexPipeStream.cs (1)
121var result = await _input.ReadAsync(cancellationToken);
IIS.ShadowCopy.Tests (1)
src\Shared\ServerInfrastructure\DuplexPipeStream.cs (1)
121var result = await _input.ReadAsync(cancellationToken);
IISExpress.FunctionalTests (1)
src\Shared\ServerInfrastructure\DuplexPipeStream.cs (1)
121var result = await _input.ReadAsync(cancellationToken);
InMemory.FunctionalTests (44)
ChunkedRequestTests.cs (6)
45var readResult = await request.BodyReader.ReadAsync(); 389var result = await request.BodyReader.ReadAsync(); 918var readResult = await request.BodyReader.ReadAsync(); 974var readResult = await request.BodyReader.ReadAsync(); 1024var readResult = await request.BodyReader.ReadAsync(); 1087var readResult = await request.BodyReader.ReadAsync();
Http2\Http2ConnectionTests.cs (2)
1387var readResult = await context.Request.BodyReader.ReadAsync(); 5660var result = await context.Request.BodyReader.ReadAsync().DefaultTimeout();
Http2\Http2StreamTests.cs (3)
998var readResult = await context.Request.BodyReader.ReadAsync(); 1042var readResult = await context.Request.BodyReader.ReadAsync(); 1281var readResult = await context.Request.BodyReader.ReadAsync();
Http2\TlsTests.cs (1)
109var result = await reader.ReadAsync();
Http3\Http3StreamTests.cs (1)
622var readResult = await context.Request.BodyReader.ReadAsync();
Http3\WebTransport\WebTransportTestUtilities.cs (3)
190public override ValueTask<ReadResult> ReadAsync(CancellationToken cancellationToken = default) 193return new ValueTask<ReadResult>(new ReadResult( 197public override bool TryRead(out ReadResult result)
KestrelMetricsTests.cs (1)
173var result = await context.Request.BodyReader.ReadAsync();
RequestTests.cs (13)
96var data = await context.Request.BodyReader.ReadAsync(); 970var readResult = await httpContext.Request.BodyReader.ReadAsync().AsTask().DefaultTimeout(); 1017var readResult = await httpContext.Request.BodyReader.ReadAsync(); 1049var readResult = await httpContext.Request.BodyReader.ReadAsync(); 1084var readResult = await httpContext.Request.BodyReader.ReadAsync(); 1163static async Task<ReadResult> ReadAtLeastAsync(PipeReader reader, int numBytes) 1165var result = await reader.ReadAsync(); 1184var readResult = await ReadAtLeastAsync(httpContext.Request.BodyReader, numBytes: 3); 1238var readResult = await httpContext.Request.BodyReader.ReadAsync(); 1910var readResult = await request.BodyReader.ReadAsync(); 1960var readResult = await request.BodyReader.ReadAsync(); 2002var readResult = await request.BodyReader.ReadAsync(); 2045var readResult = await request.BodyReader.ReadAsync();
src\Servers\Kestrel\shared\CompletionPipeReader.cs (2)
52public override ValueTask<ReadResult> ReadAsync(CancellationToken cancellationToken = default) 57public override bool TryRead(out ReadResult result)
src\Servers\Kestrel\shared\test\Http3\Http3InMemory.cs (6)
526var result = await ReadApplicationInputAsync(); 534protected Task<ReadResult> ReadApplicationInputAsync() 551var result = await ReadApplicationInputAsync(); 633var result = await ReadApplicationInputAsync(); 765var result = await ReadApplicationInputAsync(); 928var result = await ReadApplicationInputAsync();
src\Servers\Kestrel\shared\test\PassThroughConnectionMiddleware.cs (2)
78public override ValueTask<ReadResult> ReadAsync(CancellationToken cancellationToken = default) => _input.ReadAsync(cancellationToken); 80public override bool TryRead(out ReadResult result) => _input.TryRead(out result);
TestTransport\InMemoryTransportConnection.cs (4)
147public override ValueTask<ReadResult> ReadAsync(CancellationToken cancellationToken = default) 156return new ValueTask<ReadResult>(new ObservableValueTask<ReadResult>(task, _tcs), 0); 159public override bool TryRead(out ReadResult result)
Interop.FunctionalTests (4)
HttpClientHttp2InteropTests.cs (4)
273var readResult = await reader.ReadAsync().DefaultTimeout(); 286var finalResult = await reader.ReadAsync().DefaultTimeout(); 330var readResult = await reader.ReadAsync().DefaultTimeout(); 357var finalResult = await reader.ReadAsync().DefaultTimeout();
Microsoft.AspNetCore.Grpc.JsonTranscoding.Tests (1)
ServerStreamingServerCallHandlerTests.cs (1)
267var result = await pipeReader.ReadAsync();
Microsoft.AspNetCore.Http.Connections (3)
Internal\Transports\LongPollingServerTransport.cs (1)
36var result = await _application.ReadAsync(token);
Internal\Transports\ServerSentEventsServerTransport.cs (1)
51var result = await _application.ReadAsync(cancellationToken);
Internal\Transports\WebSocketsServerTransport.cs (1)
208var result = await _application.Input.ReadAsync();
Microsoft.AspNetCore.Http.Connections.Client (2)
Internal\SendUtils.cs (1)
27var result = await application.Input.ReadAsync(cancellationToken).ConfigureAwait(false);
Internal\WebSocketsTransport.cs (1)
540var result = await _application.Input.ReadAsync().ConfigureAwait(false);
Microsoft.AspNetCore.Http.Connections.Tests (16)
HttpConnectionDispatcherTests.cs (11)
244Assert.True(connection.Transport.Input.TryRead(out var result)); 479var result = await connectionContext.Transport.Input.ReadAsync(); 543var result = await connectionContext.Transport.Input.ReadAsync(); 612Assert.True(connection.Transport.Input.TryRead(out var result)); 3817var result = connection.Transport.Input.ReadAsync().AsTask().Result; 3845var result = await connection.Transport.Input.ReadAsync(); 3884var result = await connection.Transport.Input.ReadAsync(); 3907var result = await connection.Transport.Input.ReadAsync(); 3937var result = await connection.Transport.Input.ReadAsync(); 3964var result = await connection.Transport.Input.ReadAsync(); 4013var res = await connection.Transport.Input.ReadAsync(connection.ConnectionClosed);
HttpConnectionManagerTests.cs (2)
109var result = await connection.Transport.Input.ReadAsync(); 251var result = await connection.Transport.Input.ReadAsync();
MapConnectionHandlerTests.cs (1)
436var result = await connection.Transport.Input.ReadAsync();
WebSocketsTests.cs (2)
54var result = await connection.Transport.Input.ReadAsync(); 132var result = await connection.Transport.Input.ReadAsync();
Microsoft.AspNetCore.Http.Extensions.Tests (4)
RequestDelegateGenerator\RequestDelegateCreationTests.JsonBody.cs (4)
249var result = await httpContext.Request.BodyReader.ReadAsync(); 290var result = await httpContext.Request.BodyReader.ReadAsync(); 331var result = await httpContext.Request.BodyReader.ReadAsync(); 372var result = await httpContext.Request.BodyReader.ReadAsync();
Microsoft.AspNetCore.Http.Tests (3)
Features\RequestBodyPipeFeatureTests.cs (3)
37var data = await feature.Reader.ReadAsync(); 58var data = await feature.Reader.ReadAsync(); 65private static string GetStringFromReadResult(ReadResult data)
Microsoft.AspNetCore.OutputCaching.Tests (1)
CachedResponseBodyTests.cs (1)
100var result = await reader.ReadAsync(cancellationToken);
Microsoft.AspNetCore.ResponseCaching.Microbenchmarks (1)
ResponseCachingBenchmark.cs (1)
98var result = await reader.ReadAsync(cancellationToken);
Microsoft.AspNetCore.ResponseCaching.Tests (1)
CachedResponseBodyTests.cs (1)
105var result = await reader.ReadAsync(cancellationToken);
Microsoft.AspNetCore.Server.HttpSys.FunctionalTests (1)
src\Shared\ServerInfrastructure\DuplexPipeStream.cs (1)
121var result = await _input.ReadAsync(cancellationToken);
Microsoft.AspNetCore.Server.IIS (3)
Core\IISHttpContext.IO.cs (2)
30var result = await _bodyInputPipe!.Reader.ReadAsync(cancellationToken); 163var result = await _bodyOutput.Reader.ReadAsync();
src\Shared\ServerInfrastructure\DuplexPipeStream.cs (1)
121var result = await _input.ReadAsync(cancellationToken);
Microsoft.AspNetCore.Server.Kestrel.Core (60)
Internal\Http\Http1ChunkedEncodingMessageBody.cs (4)
28private ReadResult _readResult; 42public override bool TryReadInternal(out ReadResult readResult) 59public override async ValueTask<ReadResult> ReadAsyncInternal(CancellationToken cancellationToken = default) 106var result = await awaitable;
Internal\Http\Http1Connection.cs (2)
715protected override bool BeginRead(out ValueTask<ReadResult> awaitable) 721protected override bool TryParseRequest(ReadResult result, out bool endConnection)
Internal\Http\Http1ContentLengthMessageBody.cs (3)
15private ReadResult _readResult; 32public override async ValueTask<ReadResult> ReadAsyncInternal(CancellationToken cancellationToken = default) 119public override bool TryReadInternal(out ReadResult readResult)
Internal\Http\Http1MessageBody.cs (6)
27public override ValueTask<ReadResult> ReadAsync(CancellationToken cancellationToken = default) 33public abstract ValueTask<ReadResult> ReadAsyncInternal(CancellationToken cancellationToken = default); 35public override bool TryRead(out ReadResult readResult) 41public abstract bool TryReadInternal(out ReadResult readResult); 53while (TryReadInternal(out var readResult)) 90ReadResult result;
Internal\Http\Http1UpgradeMessageBody.cs (9)
26public override ValueTask<ReadResult> ReadAsync(CancellationToken cancellationToken = default) 32public override bool TryRead(out ReadResult result) 59public override bool TryReadInternal(out ReadResult readResult) 73public override ValueTask<ReadResult> ReadAsyncInternal(CancellationToken cancellationToken = default) 75ReadResult readResult; 90return new ValueTask<ReadResult>(readResult); 94private async ValueTask<ReadResult> ReadAsyncInternalAwaited(ValueTask<ReadResult> readTask, CancellationToken cancellationToken = default) 96var readResult = await readTask;
Internal\Http\HttpProtocol.cs (4)
457protected virtual bool BeginRead(out ValueTask<ReadResult> awaitable) 467protected abstract bool TryParseRequest(ReadResult result, out bool endConnection); 650var result = default(ReadResult);
Internal\Http\HttpRequestPipeReader.cs (2)
59public override ValueTask<ReadResult> ReadAsync(CancellationToken cancellationToken = default) 66public override bool TryRead(out ReadResult result)
Internal\Http\HttpRequestStream.cs (1)
118var result = await _pipeReader.ReadAsync(cancellationToken);
Internal\Http\MessageBody.cs (7)
48public abstract ValueTask<ReadResult> ReadAsync(CancellationToken cancellationToken = default); 50public abstract bool TryRead(out ReadResult readResult); 203protected ValueTask<ReadResult> StartTimingReadAsync(ValueTask<ReadResult> readAwaitable, CancellationToken cancellationToken) 227protected async ValueTask<ReadResult> StartTimingReadAwaited(ValueTask<FlushResult> continueTask, ValueTask<ReadResult> readAwaitable, CancellationToken cancellationToken) 261protected long TrackConsumedAndExaminedBytes(ReadResult readResult, SequencePosition consumed, SequencePosition examined)
Internal\Http\ZeroContentLengthMessageBody.cs (3)
18public override ValueTask<ReadResult> ReadAsync(CancellationToken cancellationToken = default) => new ValueTask<ReadResult>(new ReadResult(default, isCanceled: false, isCompleted: true)); 26public override bool TryRead(out ReadResult result)
Internal\Http2\Http2Connection.cs (3)
320var result = await Input.ReadAsync(); 553var result = await Input.ReadAsync(); 1857var readResult = await reader.ReadAsync();
Internal\Http2\Http2FrameWriter.cs (1)
192reader.TryRead(out var readResult);
Internal\Http2\Http2MessageBody.cs (3)
24private ReadResult _readResult; 83public override bool TryRead(out ReadResult readResult) 105public override async ValueTask<ReadResult> ReadAsync(CancellationToken cancellationToken = default)
Internal\Http2\Http2Stream.cs (1)
214protected override bool TryParseRequest(ReadResult result, out bool endConnection)
Internal\Http3\Http3ControlStream.cs (3)
153var result = await Input.ReadAsync(); 252var result = await Input.ReadAsync(); 291var result = await Input.ReadAsync();
Internal\Http3\Http3MessageBody.cs (3)
15private ReadResult _readResult; 51public override bool TryRead(out ReadResult readResult) 73public override async ValueTask<ReadResult> ReadAsync(CancellationToken cancellationToken = default)
Internal\Http3\Http3OutputProducer.cs (1)
417ReadResult readResult;
Internal\Http3\Http3PendingStream.cs (1)
50var result = await Input.ReadAsync();
Internal\Http3\Http3Stream.cs (2)
614var result = await Input.ReadAsync(); 961protected override bool TryParseRequest(ReadResult result, out bool endConnection)
src\Shared\ServerInfrastructure\DuplexPipeStream.cs (1)
121var result = await _input.ReadAsync(cancellationToken);
Microsoft.AspNetCore.Server.Kestrel.Core.Tests (47)
BodyControlTests.cs (4)
101Assert.Throws<Exception>(() => requestPipe.TryRead(out var res))); 118Assert.Throws<ObjectDisposedException>(() => requestPipe.TryRead(out var res)); 164public override ValueTask<ReadResult> ReadAsync(CancellationToken cancellationToken = default) 169public override bool TryRead(out ReadResult readResult)
BufferWriterTests.cs (2)
29ReadResult readResult = Pipe.Reader.ReadAsync().GetAwaiter().GetResult(); 202var readResult = Pipe.Reader.ReadAsync().GetAwaiter().GetResult();
Http1\Http1ConnectionTests.cs (2)
199var read = await _application.Input.ReadAsync(); 218static bool TryReadResponse(ReadResult read, out SequencePosition consumed, out SequencePosition examined)
Http1\Http1OutputProducerTests.cs (1)
51Assert.False(socketOutput.Pipe.Reader.TryRead(out var result));
Http2\Http2FrameWriterTests.cs (1)
104var result = await pipeReader.ReadAsync();
HttpRequestStreamTests.cs (1)
112mockMessageBody.Setup(m => m.ReadAsync(CancellationToken.None)).Returns(new ValueTask<ReadResult>(new ReadResult(default, isCanceled: false, isCompleted: true)));
MessageBodyTests.cs (27)
69var readResult = await reader.ReadAsync(); 96Assert.True(reader.TryRead(out var readResult)); 123var readResult = await reader.ReadAsync(); 144Assert.True(reader.TryRead(out var readResult)); 640body.TryRead(out var readResult); 895var readResult = await readTask1; 991var readResult = await readResultTask; 1012var readResult = await readResultTask; 1033var readResult = await readResultTask; 1056var readResult = await readResultTask; 1075Assert.True(reader.TryRead(out var readResult)); 1094Assert.True(reader.TryRead(out var readResult)); 1121Assert.True(reader.TryRead(out var readResult)); 1147Assert.True(reader.TryRead(out var readResult)); 1170Assert.True(reader.TryRead(out var readResult)); 1194Assert.True(reader.TryRead(out var readResult)); 1221var ex0 = Assert.Throws<BadHttpRequestException>(() => reader.TryRead(out var readResult)); 1222var ex1 = Assert.Throws<BadHttpRequestException>(() => reader.TryRead(out var readResult)); 1247var readResult = await reader.ReadAsync(); 1254var ex0 = Assert.Throws<BadHttpRequestException>(() => reader.TryRead(out var readResult)); 1255var ex1 = Assert.Throws<BadHttpRequestException>(() => reader.TryRead(out var readResult)); 1281var ex0 = Assert.Throws<BadHttpRequestException>(() => reader.TryRead(out var readResult)); 1282var ex1 = Assert.Throws<BadHttpRequestException>(() => reader.TryRead(out var readResult)); 1307Assert.True(reader.TryRead(out var readResult)); 1331Assert.True(reader.TryRead(out var readResult)); 1357Assert.True(reader.TryRead(out var readResult)); 1383Assert.True(reader.TryRead(out var readResult));
PipelineExtensionTests.cs (7)
45var reader = _pipe.Reader.ReadAsync().GetAwaiter().GetResult(); 62var readResult = _pipe.Reader.ReadAsync().GetAwaiter().GetResult(); 88var reader = _pipe.Reader.ReadAsync().GetAwaiter().GetResult(); 114var reader = _pipe.Reader.ReadAsync().GetAwaiter().GetResult(); 142var reader = _pipe.Reader.ReadAsync().GetAwaiter().GetResult(); 160var reader = _pipe.Reader.ReadAsync().GetAwaiter().GetResult(); 193var reader = _pipe.Reader.ReadAsync().GetAwaiter().GetResult();
src\Servers\Kestrel\shared\test\PassThroughConnectionMiddleware.cs (2)
78public override ValueTask<ReadResult> ReadAsync(CancellationToken cancellationToken = default) => _input.ReadAsync(cancellationToken); 80public override bool TryRead(out ReadResult result) => _input.TryRead(out result);
Microsoft.AspNetCore.Server.Kestrel.Microbenchmarks (15)
ChunkWriterBenchmark.cs (1)
39var result = await _reader.ReadAsync();
Http2\Http2ConnectionBenchmarkBase.cs (1)
156var result = await pipeReader.ReadAsync();
InMemoryTransportBenchmark.cs (2)
196var result = await Output.ReadAsync(); 213var result = await Output.ReadAsync();
PipeThroughputBenchmark.cs (2)
44var result = await _pipe.Reader.ReadAsync(); 61var result = _pipe.Reader.ReadAsync().GetAwaiter().GetResult();
RequestParsingBenchmark.cs (1)
180var result = awaitable.GetAwaiter().GetResult();
src\Servers\Kestrel\shared\CompletionPipeReader.cs (2)
52public override ValueTask<ReadResult> ReadAsync(CancellationToken cancellationToken = default) 57public override bool TryRead(out ReadResult result)
src\Servers\Kestrel\shared\test\Http3\Http3InMemory.cs (6)
526var result = await ReadApplicationInputAsync(); 539protected ValueTask<ReadResult> ReadApplicationInputAsync() 551var result = await ReadApplicationInputAsync(); 633var result = await ReadApplicationInputAsync(); 765var result = await ReadApplicationInputAsync(); 928var result = await ReadApplicationInputAsync();
Microsoft.AspNetCore.Server.Kestrel.Transport.NamedPipes (1)
Internal\NamedPipeConnection.cs (1)
157var result = await Output.ReadAsync();
Microsoft.AspNetCore.Server.Kestrel.Transport.Quic (3)
Internal\QuicStreamContext.cs (1)
383var result = await output.ReadAsync();
src\Servers\Kestrel\shared\CompletionPipeReader.cs (2)
52public override ValueTask<ReadResult> ReadAsync(CancellationToken cancellationToken = default) 57public override bool TryRead(out ReadResult result)
Microsoft.AspNetCore.Server.Kestrel.Transport.Quic.Tests (3)
QuicConnectionContextTests.cs (2)
109var read = await serverStream.Transport.Input.ReadAtLeastAsync(TestData.Length).DefaultTimeout(); 612var readResult = await serverStream.Transport.Input.ReadAtLeastAsync(TestData.Length).DefaultTimeout();
QuicTestHelpers.cs (1)
155var readResult = await serverStream.Transport.Input.ReadAtLeastAsync(TestData.Length).DefaultTimeout();
Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets (1)
Internal\SocketConnection.cs (1)
274var result = await Output.ReadAsync();
Microsoft.AspNetCore.Shared.Tests (1)
src\Shared\ServerInfrastructure\DuplexPipeStream.cs (1)
121var result = await _input.ReadAsync(cancellationToken);
Microsoft.AspNetCore.SignalR.Client.Core (2)
HubConnection.cs (2)
1510var result = await input.ReadAsync(linkedToken).ConfigureAwait(false); 1630var result = await input.ReadAsync().ConfigureAwait(false);
Microsoft.AspNetCore.SignalR.Client.Tests (3)
HttpConnectionTests.Transport.cs (1)
409var message = await connection.Transport.Input.ReadAtLeastAsync(14);
TestConnection.cs (1)
148var result = await Application.Input.ReadAsync();
TestTransport.cs (1)
59var result = await Application.Input.ReadAsync();
Microsoft.AspNetCore.SignalR.Core (2)
HubConnectionContext.cs (1)
510var result = await input.ReadAsync();
HubConnectionHandler.cs (1)
273var result = await input.ReadAsync();
Microsoft.AspNetCore.SignalR.Microbenchmarks (26)
BroadcastBenchmark.cs (1)
78var result = await application.Input.ReadAsync();
HubConnectionContextBenchmark.cs (3)
23private ReadResult _handshakeRequestResult; 57_pipe.AddReadResult(new ValueTask<ReadResult>(_handshakeRequestResult)); 66_pipe.AddReadResult(new ValueTask<ReadResult>(_handshakeRequestResult));
HubConnectionReceiveBenchmark.cs (9)
30private TaskCompletionSource<ReadResult> _tcs; 31private TaskCompletionSource<ReadResult> _nextReadTcs; 47var handshakeResponseResult = new ReadResult(new ReadOnlySequence<byte>(writer.ToArray()), false, false); 50_pipe.AddReadResult(new ValueTask<ReadResult>(handshakeResponseResult)); 57_nextReadTcs = new TaskCompletionSource<ReadResult>(); 58_pipe.AddReadResult(new ValueTask<ReadResult>(_nextReadTcs.Task)); 137_pipe.AddReadResult(new ValueTask<ReadResult>(new ReadResult(new ReadOnlySequence<byte>(_invocationMessageBytes), false, false))); 141_nextReadTcs = new TaskCompletionSource<ReadResult>(); 142_pipe.AddReadResult(new ValueTask<ReadResult>(_nextReadTcs.Task));
HubConnectionSendBenchmark.cs (5)
22private TaskCompletionSource<ReadResult> _tcs; 32var handshakeResponseResult = new ReadResult(new ReadOnlySequence<byte>(writer.ToArray()), false, false); 35_pipe.AddReadResult(new ValueTask<ReadResult>(handshakeResponseResult)); 42_tcs = new TaskCompletionSource<ReadResult>(); 43_pipe.AddReadResult(new ValueTask<ReadResult>(_tcs.Task));
HubConnectionStartBenchmark.cs (2)
22private ReadResult _handshakeResponseResult; 58_pipe.AddReadResult(new ValueTask<ReadResult>(_handshakeResponseResult));
Shared\TestDuplexPipe.cs (1)
25public void AddReadResult(ValueTask<ReadResult> readResult)
Shared\TestPipeReader.cs (5)
10public List<ValueTask<ReadResult>> ReadResults { get; } 14ReadResults = new List<ValueTask<ReadResult>>(); 35public override ValueTask<ReadResult> ReadAsync(CancellationToken cancellationToken = new CancellationToken()) 39return new ValueTask<ReadResult>(new ReadResult(default, false, true)); 48public override bool TryRead(out ReadResult result)
Microsoft.AspNetCore.SignalR.Specification.Tests (2)
src\SignalR\common\testassets\Tests.Utils\TestClient.cs (2)
248var result = await Connection.Application.Input.ReadAsync(); 277if (!Connection.Application.Input.TryRead(out var result))
Microsoft.AspNetCore.SignalR.Tests (18)
AuthConnectionHandler.cs (1)
18var result = await connection.Transport.Input.ReadAsync();
EchoConnectionHandler.cs (1)
16var result = await connection.Transport.Input.ReadAsync();
HttpHeaderConnectionHandler.cs (1)
18var result = await connection.Transport.Input.ReadAsync();
HubConnectionHandlerTests.cs (2)
2956public override async ValueTask<ReadResult> ReadAsync(CancellationToken cancellationToken = default) 2976public override bool TryRead(out ReadResult result) =>
Internal\MessageBufferTests.cs (12)
34var res = await pipes.Application.Input.ReadAsync().DefaultTimeout(); 59var res = await pipes.Application.Input.ReadAsync(); 101var res = await pipes.Application.Input.ReadAsync(); 134var res = await pipes.Application.Input.ReadAsync(); 183var res = await pipes.Application.Input.ReadAsync(); 228var res = await pipes.Application.Input.ReadAsync(); 260var res = await pipes.Application.Input.ReadAsync(); 297var res = await pipes.Application.Input.ReadAsync(); 342var res = await pipes.Application.Input.ReadAsync(); 378var res = await pipes.Application.Input.ReadAsync(); 422var res = await pipes.Application.Input.ReadAsync(); 469var res = await pipes.Application.Input.ReadAsync();
WriteThenCloseConnectionHandler.cs (1)
14var result = await connection.Transport.Input.ReadAsync();
Microsoft.AspNetCore.SignalR.Tests.Utils (7)
PipeReaderExtensions.cs (5)
14var result = await pipeReader.ReadAsync(); 40var result = await pipeReader.ReadAsync(); 57var result = await pipeReader.ReadAsync(); 73var result = await pipeReader.ReadAsync(); 89var result = await pipeReader.ReadAsync();
TestClient.cs (2)
248var result = await Connection.Application.Input.ReadAsync(); 277if (!Connection.Application.Input.TryRead(out var result))
Microsoft.AspNetCore.TestHost (2)
HttpContextBuilder.cs (1)
196return !_requestPipe.Reader.TryRead(out var result) || !result.IsCompleted;
ResponseBodyReaderStream.cs (1)
87var result = await _pipe.Reader.ReadAsync(cancellationToken);
Microsoft.AspNetCore.WebUtilities (1)
FormPipeReader.cs (1)
96var readResult = await _pipeReader.ReadAsync(cancellationToken);
Microsoft.AspNetCore.WebUtilities.Tests (5)
FormPipeReaderTests.cs (5)
113var readResult = await bodyPipe.ReadAsync(); 128var readResult = await bodyPipe.ReadAsync(); 156var readResult = await bodyPipe.ReadAsync(); 184var readResult = await bodyPipe.ReadAsync(); 209var readResult = await bodyPipe.Reader.ReadAsync();
Microsoft.CodeAnalysis.Remote.Workspaces (2)
RemoteHostAssetReader.cs (2)
120private static (byte, int) ReadSentinelAndLength(ReadResult readResult) 128private static Checksum ReadChecksum(ReadResult readResult)
SignalR.Client.FunctionalTestApp (1)
EchoConnectionHandler.cs (1)
15var result = await connection.Transport.Input.ReadAsync();
SignalRSamples (1)
ConnectionHandlers\MessagesConnectionHandler.cs (1)
27var result = await connection.Transport.Input.ReadAsync();
SocialWeather (1)
SocialWeatherConnectionHandler.cs (1)
37var result = await connection.Transport.Input.ReadAsync();
Sockets.FunctionalTests (5)
src\Servers\Kestrel\shared\test\PassThroughConnectionMiddleware.cs (2)
78public override ValueTask<ReadResult> ReadAsync(CancellationToken cancellationToken = default) => _input.ReadAsync(cancellationToken); 80public override bool TryRead(out ReadResult result) => _input.TryRead(out result);
src\Servers\Kestrel\test\FunctionalTests\ConnectionMiddlewareTests.cs (2)
117public override ValueTask<ReadResult> ReadAsync(CancellationToken cancellationToken = default) 122public override bool TryRead(out ReadResult result)
src\Servers\Kestrel\test\FunctionalTests\UnixDomainSocketsTests.cs (1)
55var result = await connection.Transport.Input.ReadAsync(notificationFeature.ConnectionClosedRequested);
System.IO.Pipelines (60)
System\IO\Pipelines\Pipe.cs (18)
682internal ValueTask<ReadResult> ReadAtLeastAsync(int minimumBytes, CancellationToken token) 691return new ValueTask<ReadResult>(Task.FromCanceled<ReadResult>(token)); 695ValueTask<ReadResult> result; 703GetReadResult(out ReadResult readResult); 708return new ValueTask<ReadResult>(readResult); 733result = new ValueTask<ReadResult>(_reader, token: 0); 741internal ValueTask<ReadResult> ReadAsync(CancellationToken token) 750return new ValueTask<ReadResult>(Task.FromCanceled<ReadResult>(token)); 753ValueTask<ReadResult> result; 761GetReadResult(out ReadResult readResult); 762result = new ValueTask<ReadResult>(readResult); 767result = new ValueTask<ReadResult>(_reader, token: 0); 774internal bool TryRead(out ReadResult result) 931internal ReadResult GetReadAsyncResult() 933ReadResult result; 962private void GetReadResult(out ReadResult result)
System\IO\Pipelines\Pipe.DefaultPipeReader.cs (5)
13private sealed class DefaultPipeReader : PipeReader, IValueTaskSource<ReadResult> 22public override bool TryRead(out ReadResult result) => _pipe.TryRead(out result); 24public override ValueTask<ReadResult> ReadAsync(CancellationToken cancellationToken = default) => _pipe.ReadAsync(cancellationToken); 26protected override ValueTask<ReadResult> ReadAtLeastAsyncCore(int minimumBytes, CancellationToken cancellationToken) => _pipe.ReadAtLeastAsync(minimumBytes, cancellationToken); 42public ReadResult GetResult(short token) => _pipe.GetReadAsyncResult();
System\IO\Pipelines\PipeReader.cs (11)
16/// <param name="result">When this method returns <see langword="true" />, this value is set to a <see cref="System.IO.Pipelines.ReadResult" /> instance that represents the result of the read call; otherwise, this value is set to <see langword="default" />.</param> 27public abstract bool TryRead(out ReadResult result); 32public abstract ValueTask<ReadResult> ReadAsync(CancellationToken cancellationToken = default); 51public ValueTask<ReadResult> ReadAtLeastAsync(int minimumSize, CancellationToken cancellationToken = default) 66protected virtual async ValueTask<ReadResult> ReadAtLeastAsyncCore(int minimumSize, CancellationToken cancellationToken) 70ReadResult result = await ReadAsync(cancellationToken).ConfigureAwait(false); 86/// The <see cref="System.IO.Pipelines.ReadResult.Buffer" /> previously returned from <see cref="System.IO.Pipelines.PipeReader.ReadAsync(System.Threading.CancellationToken)" /> must not be accessed after this call. 96/// The <see cref="System.IO.Pipelines.ReadResult.Buffer" /> previously returned from <see cref="System.IO.Pipelines.PipeReader.ReadAsync(System.Threading.CancellationToken)" /> must not be accessed after this call. 118/// <remarks>The canceled <see cref="System.IO.Pipelines.PipeReader.ReadAsync(System.Threading.CancellationToken)" /> operation returns a <see cref="System.IO.Pipelines.ReadResult" /> where <see cref="System.IO.Pipelines.ReadResult.IsCanceled" /> is <see langword="true" />.</remarks> 236ReadResult result = await ReadAsync(cancellationToken).ConfigureAwait(false);
System\IO\Pipelines\PipeReaderStream.cs (4)
66ValueTask<ReadResult> vt = _pipeReader.ReadAsync(); 67ReadResult result = vt.IsCompletedSuccessfully ? vt.Result : vt.AsTask().GetAwaiter().GetResult(); 107ReadResult result = await _pipeReader.ReadAsync(cancellationToken).ConfigureAwait(false); 111private int HandleReadResult(ReadResult result, Span<byte> buffer)
System\IO\Pipelines\ReadResult.cs (5)
14/// <summary>Creates a new instance of <see cref="System.IO.Pipelines.ReadResult" /> setting <see cref="System.IO.Pipelines.ReadResult.IsCanceled" /> and <see cref="System.IO.Pipelines.ReadResult.IsCompleted" /> flags.</summary> 16/// <param name="isCanceled">A flag that indicates if the <see cref="System.IO.Pipelines.PipeReader.ReadAsync(System.Threading.CancellationToken)" /> operation that produced this <see cref="System.IO.Pipelines.ReadResult" /> was canceled by <see cref="System.IO.Pipelines.PipeReader.CancelPendingRead" />.</param> 38/// <value><see langword="true" /> if the <see cref="System.IO.Pipelines.PipeReader.ReadAsync(System.Threading.CancellationToken)" /> operation that produced this <see cref="System.IO.Pipelines.ReadResult" /> was canceled by <see cref="System.IO.Pipelines.PipeReader.CancelPendingRead" />; otherwise, <see langword="false" />.</value>
System\IO\Pipelines\SequencePipeReader.cs (5)
62public override ValueTask<ReadResult> ReadAsync(CancellationToken cancellationToken = default) 64if (TryRead(out ReadResult result)) 66return new ValueTask<ReadResult>(result); 70return new ValueTask<ReadResult>(result); 74public override bool TryRead(out ReadResult result)
System\IO\Pipelines\StreamPipeReader.cs (12)
201public override ValueTask<ReadResult> ReadAsync(CancellationToken cancellationToken = default) 206protected override ValueTask<ReadResult> ReadAtLeastAsyncCore(int minimumSize, CancellationToken cancellationToken) 211private ValueTask<ReadResult> ReadInternalAsync(int? minimumSize, CancellationToken cancellationToken) 218return new ValueTask<ReadResult>(Task.FromCanceled<ReadResult>(cancellationToken)); 223if (TryReadInternal(tokenSource, out ReadResult readResult)) 230return new ValueTask<ReadResult>(readResult); 236ReadResult completedResult = new ReadResult(buffer: default, isCanceled: false, isCompleted: true); 237return new ValueTask<ReadResult>(completedResult); 245static async ValueTask<ReadResult> Core(StreamPipeReader reader, int? minimumSize, CancellationTokenSource tokenSource, CancellationToken cancellationToken) 458public override bool TryRead(out ReadResult result) 465private bool TryReadInternal(CancellationTokenSource source, out ReadResult result)