예제 #1
0
                public override ValueTask <int> ReadAsync(Memory <byte> destination, CancellationToken cancellationToken)
                {
                    Http2Stream http2Stream = _http2Stream;

                    if (http2Stream == null)
                    {
                        return(new ValueTask <int>(Task.FromException <int>(new ObjectDisposedException(nameof(Http2ReadStream)))));
                    }

                    return(http2Stream.ReadDataAsync(destination, cancellationToken));
                }
예제 #2
0
                public override ValueTask <int> ReadAsync(Memory <byte> destination, CancellationToken cancellationToken)
                {
                    Http2Stream http2Stream = _http2Stream;

                    if (http2Stream == null)
                    {
                        return(new ValueTask <int>(Task.FromException <int>(new ObjectDisposedException(nameof(Http2ReadStream)))));
                    }

                    if (http2Stream._abortException != null)
                    {
                        return(new ValueTask <int>(Task.FromException <int>(new IOException(SR.net_http_client_execution_error, http2Stream._abortException))));
                    }

                    return(http2Stream.ReadDataAsync(destination, cancellationToken));
                }
예제 #3
0
 public override ValueTask <int> ReadAsync(Memory <byte> destination, CancellationToken cancellationToken)
 {
     return(_http2Stream.ReadDataAsync(destination, cancellationToken));
 }