@@ -69,7 +69,7 @@ public async Task<TResponse> UnaryCall<TRequest, TResponse>(
6969 using var call = callInvoker . AsyncUnaryCall (
7070 method : method ,
7171 host : null ,
72- options : GetCallOptions ( settings , false ) ,
72+ options : GetCallOptions ( settings ) ,
7373 request : request
7474 ) ;
7575
@@ -98,7 +98,7 @@ public ServerStream<TResponse> ServerStreamCall<TRequest, TResponse>(
9898 var call = callInvoker . AsyncServerStreamingCall (
9999 method : method ,
100100 host : null ,
101- options : GetCallOptions ( settings , true ) ,
101+ options : GetCallOptions ( settings ) ,
102102 request : request ) ;
103103
104104 return new ServerStream < TResponse > ( call , e => { OnRpcError ( endpoint , e ) ; } ) ;
@@ -116,7 +116,7 @@ public IBidirectionalStream<TRequest, TResponse> BidirectionalStreamCall<TReques
116116 var call = callInvoker . AsyncDuplexStreamingCall (
117117 method : method ,
118118 host : null ,
119- options : GetCallOptions ( settings , true ) ) ;
119+ options : GetCallOptions ( settings ) ) ;
120120
121121 return new BidirectionalStream < TRequest , TResponse > ( call , e => { OnRpcError ( endpoint , e ) ; } ) ;
122122 }
@@ -125,7 +125,7 @@ public IBidirectionalStream<TRequest, TResponse> BidirectionalStreamCall<TReques
125125
126126 protected abstract void OnRpcError ( string endpoint , RpcException e ) ;
127127
128- protected CallOptions GetCallOptions ( GrpcRequestSettings settings , bool streaming )
128+ protected CallOptions GetCallOptions ( GrpcRequestSettings settings )
129129 {
130130 var meta = new Grpc . Core . Metadata
131131 {
@@ -143,22 +143,13 @@ protected CallOptions GetCallOptions(GrpcRequestSettings settings, bool streamin
143143 meta . Add ( Metadata . RpcTraceIdHeader , settings . TraceId ) ;
144144 }
145145
146- var transportTimeout = streaming
147- ? Config . DefaultStreamingTransportTimeout
148- : Config . DefaultTransportTimeout ;
149-
150- if ( settings . TransportTimeout != null )
151- {
152- transportTimeout = settings . TransportTimeout . Value ;
153- }
154-
155146 var options = new CallOptions (
156147 headers : meta
157148 ) ;
158149
159- if ( transportTimeout != TimeSpan . Zero )
150+ if ( settings . TransportTimeout != TimeSpan . Zero )
160151 {
161- options = options . WithDeadline ( DateTime . UtcNow + transportTimeout ) ;
152+ options = options . WithDeadline ( DateTime . UtcNow + settings . TransportTimeout ) ;
162153 }
163154
164155 return options ;
0 commit comments