예제 #1
0
        public Metadata GetTrailers()
        {
            if (_trailers == null)
            {
                ValidateTrailersAvailable();

                _trailers = GrpcProtocolHelpers.BuildMetadata(HttpResponse.TrailingHeaders);
            }

            return(_trailers);
        }
예제 #2
0
        public async Task <Metadata> GetResponseHeadersAsync()
        {
            try
            {
                await SendTask.ConfigureAwait(false);

                // The task of this method is cached so there is no need to cache the headers here
                return(GrpcProtocolHelpers.BuildMetadata(HttpResponse.Headers));
            }
            catch (OperationCanceledException)
            {
                EnsureNotDisposed();
                throw CreateCanceledStatusException();
            }
        }
예제 #3
0
        public Metadata GetTrailers()
        {
            using (StartScope())
            {
                if (_trailers == null)
                {
                    ValidateTrailersAvailable();

                    Debug.Assert(HttpResponse != null);
                    _trailers = GrpcProtocolHelpers.BuildMetadata(HttpResponse.TrailingHeaders);
                }

                return(_trailers);
            }
        }