|
|
|
@ -76,7 +76,7 @@ namespace Grpc.Core.Internal |
|
|
|
|
|
|
|
|
|
Status status; |
|
|
|
|
Tuple<TResponse,WriteFlags> responseTuple = null; |
|
|
|
|
var context = HandlerUtils.NewContext(newRpc, asyncCall.Peer, responseStream, asyncCall.CancellationToken); |
|
|
|
|
var context = HandlerUtils.NewContext(newRpc, responseStream, asyncCall.CancellationToken); |
|
|
|
|
try |
|
|
|
|
{ |
|
|
|
|
GrpcPreconditions.CheckArgument(await requestStream.MoveNext().ConfigureAwait(false)); |
|
|
|
@ -134,7 +134,7 @@ namespace Grpc.Core.Internal |
|
|
|
|
var responseStream = new ServerResponseStream<TRequest, TResponse>(asyncCall); |
|
|
|
|
|
|
|
|
|
Status status; |
|
|
|
|
var context = HandlerUtils.NewContext(newRpc, asyncCall.Peer, responseStream, asyncCall.CancellationToken); |
|
|
|
|
var context = HandlerUtils.NewContext(newRpc, responseStream, asyncCall.CancellationToken); |
|
|
|
|
try |
|
|
|
|
{ |
|
|
|
|
GrpcPreconditions.CheckArgument(await requestStream.MoveNext().ConfigureAwait(false)); |
|
|
|
@ -193,7 +193,7 @@ namespace Grpc.Core.Internal |
|
|
|
|
|
|
|
|
|
Status status; |
|
|
|
|
Tuple<TResponse,WriteFlags> responseTuple = null; |
|
|
|
|
var context = HandlerUtils.NewContext(newRpc, asyncCall.Peer, responseStream, asyncCall.CancellationToken); |
|
|
|
|
var context = HandlerUtils.NewContext(newRpc, responseStream, asyncCall.CancellationToken); |
|
|
|
|
try |
|
|
|
|
{ |
|
|
|
|
var response = await handler(requestStream, context).ConfigureAwait(false); |
|
|
|
@ -250,7 +250,7 @@ namespace Grpc.Core.Internal |
|
|
|
|
var responseStream = new ServerResponseStream<TRequest, TResponse>(asyncCall); |
|
|
|
|
|
|
|
|
|
Status status; |
|
|
|
|
var context = HandlerUtils.NewContext(newRpc, asyncCall.Peer, responseStream, asyncCall.CancellationToken); |
|
|
|
|
var context = HandlerUtils.NewContext(newRpc, responseStream, asyncCall.CancellationToken); |
|
|
|
|
try |
|
|
|
|
{ |
|
|
|
|
await handler(requestStream, responseStream, context).ConfigureAwait(false); |
|
|
|
@ -324,13 +324,13 @@ namespace Grpc.Core.Internal |
|
|
|
|
return writeOptions != null ? writeOptions.Flags : default(WriteFlags); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public static ServerCallContext NewContext<TRequest, TResponse>(ServerRpcNew newRpc, string peer, ServerResponseStream<TRequest, TResponse> serverResponseStream, CancellationToken cancellationToken) |
|
|
|
|
public static ServerCallContext NewContext<TRequest, TResponse>(ServerRpcNew newRpc, ServerResponseStream<TRequest, TResponse> serverResponseStream, CancellationToken cancellationToken) |
|
|
|
|
where TRequest : class
|
|
|
|
|
where TResponse : class
|
|
|
|
|
{ |
|
|
|
|
DateTime realtimeDeadline = newRpc.Deadline.ToClockType(ClockType.Realtime).ToDateTime(); |
|
|
|
|
|
|
|
|
|
return new ServerCallContext(newRpc.Call, newRpc.Method, newRpc.Host, peer, realtimeDeadline, |
|
|
|
|
return new ServerCallContext(newRpc.Call, newRpc.Method, newRpc.Host, realtimeDeadline, |
|
|
|
|
newRpc.RequestMetadata, cancellationToken, serverResponseStream.WriteResponseHeadersAsync, serverResponseStream); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|