From cc97fed6d8c9569ed2a93388e8baaabfcc68c0a2 Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Wed, 5 Aug 2015 00:44:29 -0700 Subject: [PATCH] regenerated code --- src/csharp/Grpc.Core/Call.cs | 48 +++++------ src/csharp/Grpc.Core/Calls.cs | 20 ++--- src/csharp/Grpc.Core/ClientBase.cs | 4 +- src/csharp/Grpc.Examples/MathGrpc.cs | 54 +++++++++--- src/csharp/Grpc.HealthCheck/HealthGrpc.cs | 21 ++++- .../Grpc.IntegrationTesting/TestGrpc.cs | 86 +++++++++++++++---- 6 files changed, 163 insertions(+), 70 deletions(-) diff --git a/src/csharp/Grpc.Core/Call.cs b/src/csharp/Grpc.Core/Call.cs index 577c17b931d..00ccb9d1b56 100644 --- a/src/csharp/Grpc.Core/Call.cs +++ b/src/csharp/Grpc.Core/Call.cs @@ -42,64 +42,56 @@ namespace Grpc.Core /// public class Call { - readonly string name; - readonly Marshaller requestMarshaller; - readonly Marshaller responseMarshaller; readonly Channel channel; + readonly Method method; + readonly string host; readonly CallContext context; - public Call(string serviceName, Method method, Channel channel, CallContext context) + public Call(Channel channel, Method method, CallContext context) + : this(channel, method, null, context) { - this.name = method.GetFullName(serviceName); - this.requestMarshaller = method.RequestMarshaller; - this.responseMarshaller = method.ResponseMarshaller; - this.channel = channel; - this.context = context; } - public Channel Channel + public Call(Channel channel, Method method, string host, CallContext context) { - get - { - return this.channel; - } + this.channel = Preconditions.CheckNotNull(channel); + this.method = Preconditions.CheckNotNull(method); + this.host = host; + this.context = Preconditions.CheckNotNull(context); } - /// - /// Full methods name including the service name. - /// - public string Name + public Channel Channel { get { - return name; + return this.channel; } } - /// - /// Call context. - /// - public CallContext Context + public Method Method { get { - return context; + return this.method; } } - public Marshaller RequestMarshaller + public string Host { get { - return requestMarshaller; + return this.host; } } - public Marshaller ResponseMarshaller + /// + /// Call context. + /// + public CallContext Context { get { - return responseMarshaller; + return context; } } } diff --git a/src/csharp/Grpc.Core/Calls.cs b/src/csharp/Grpc.Core/Calls.cs index ef6636587e5..f975bcde224 100644 --- a/src/csharp/Grpc.Core/Calls.cs +++ b/src/csharp/Grpc.Core/Calls.cs @@ -47,8 +47,8 @@ namespace Grpc.Core where TRequest : class where TResponse : class { - var asyncCall = new AsyncCall(call.Channel, call.Name, null, call.Context, - call.RequestMarshaller.Serializer, call.ResponseMarshaller.Deserializer); + var asyncCall = new AsyncCall(call.Channel, call.Method.FullName, call.Host, call.Context, + call.Method.RequestMarshaller.Serializer, call.Method.ResponseMarshaller.Deserializer); // TODO(jtattermusch): this gives a race that cancellation can be requested before the call even starts. RegisterCancellationCallback(asyncCall, call.Context.CancellationToken); return asyncCall.UnaryCall(req); @@ -58,8 +58,8 @@ namespace Grpc.Core where TRequest : class where TResponse : class { - var asyncCall = new AsyncCall(call.Channel, call.Name, null, call.Context, - call.RequestMarshaller.Serializer, call.ResponseMarshaller.Deserializer); + var asyncCall = new AsyncCall(call.Channel, call.Method.FullName, call.Host, call.Context, + call.Method.RequestMarshaller.Serializer, call.Method.ResponseMarshaller.Deserializer); var asyncResult = asyncCall.UnaryCallAsync(req); RegisterCancellationCallback(asyncCall, call.Context.CancellationToken); return new AsyncUnaryCall(asyncResult, asyncCall.GetStatus, asyncCall.GetTrailers, asyncCall.Cancel); @@ -69,8 +69,8 @@ namespace Grpc.Core where TRequest : class where TResponse : class { - var asyncCall = new AsyncCall(call.Channel, call.Name, null, call.Context, - call.RequestMarshaller.Serializer, call.ResponseMarshaller.Deserializer); + var asyncCall = new AsyncCall(call.Channel, call.Method.FullName, call.Host, call.Context, + call.Method.RequestMarshaller.Serializer, call.Method.ResponseMarshaller.Deserializer); asyncCall.StartServerStreamingCall(req); RegisterCancellationCallback(asyncCall, call.Context.CancellationToken); var responseStream = new ClientResponseStream(asyncCall); @@ -81,8 +81,8 @@ namespace Grpc.Core where TRequest : class where TResponse : class { - var asyncCall = new AsyncCall(call.Channel, call.Name, null, call.Context, - call.RequestMarshaller.Serializer, call.ResponseMarshaller.Deserializer); + var asyncCall = new AsyncCall(call.Channel, call.Method.FullName, call.Host, call.Context, + call.Method.RequestMarshaller.Serializer, call.Method.ResponseMarshaller.Deserializer); var resultTask = asyncCall.ClientStreamingCallAsync(); RegisterCancellationCallback(asyncCall, call.Context.CancellationToken); var requestStream = new ClientRequestStream(asyncCall); @@ -93,8 +93,8 @@ namespace Grpc.Core where TRequest : class where TResponse : class { - var asyncCall = new AsyncCall(call.Channel, call.Name, null, call.Context, - call.RequestMarshaller.Serializer, call.ResponseMarshaller.Deserializer); + var asyncCall = new AsyncCall(call.Channel, call.Method.FullName, call.Host, call.Context, + call.Method.RequestMarshaller.Serializer, call.Method.ResponseMarshaller.Deserializer); asyncCall.StartDuplexStreamingCall(); RegisterCancellationCallback(asyncCall, call.Context.CancellationToken); var requestStream = new ClientRequestStream(asyncCall); diff --git a/src/csharp/Grpc.Core/ClientBase.cs b/src/csharp/Grpc.Core/ClientBase.cs index 55e3f33b3e2..e9a96866945 100644 --- a/src/csharp/Grpc.Core/ClientBase.cs +++ b/src/csharp/Grpc.Core/ClientBase.cs @@ -76,7 +76,7 @@ namespace Grpc.Core /// /// Creates a new call to given method. /// - protected Call CreateCall(string serviceName, Method method, CallContext context) + protected Call CreateCall(Method method, CallContext context) where TRequest : class where TResponse : class { @@ -86,7 +86,7 @@ namespace Grpc.Core interceptor(context.Headers); context.Headers.Freeze(); } - return new Call(serviceName, method, channel, context); + return new Call(channel, method, null, context); } } } diff --git a/src/csharp/Grpc.Examples/MathGrpc.cs b/src/csharp/Grpc.Examples/MathGrpc.cs index 67827e7b4f6..78839c4a08e 100644 --- a/src/csharp/Grpc.Examples/MathGrpc.cs +++ b/src/csharp/Grpc.Examples/MathGrpc.cs @@ -19,24 +19,28 @@ namespace math { static readonly Method __Method_Div = new Method( MethodType.Unary, + __ServiceName, "Div", __Marshaller_DivArgs, __Marshaller_DivReply); static readonly Method __Method_DivMany = new Method( MethodType.DuplexStreaming, + __ServiceName, "DivMany", __Marshaller_DivArgs, __Marshaller_DivReply); static readonly Method __Method_Fib = new Method( MethodType.ServerStreaming, + __ServiceName, "Fib", __Marshaller_FibArgs, __Marshaller_Num); static readonly Method __Method_Sum = new Method( MethodType.ClientStreaming, + __ServiceName, "Sum", __Marshaller_Num, __Marshaller_Num); @@ -45,10 +49,15 @@ namespace math { public interface IMathClient { global::math.DivReply Div(global::math.DivArgs request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)); + global::math.DivReply Div(global::math.DivArgs request, CallContext context); AsyncUnaryCall DivAsync(global::math.DivArgs request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)); + AsyncUnaryCall DivAsync(global::math.DivArgs request, CallContext context); AsyncDuplexStreamingCall DivMany(Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)); + AsyncDuplexStreamingCall DivMany(CallContext context); AsyncServerStreamingCall Fib(global::math.FibArgs request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)); + AsyncServerStreamingCall Fib(global::math.FibArgs request, CallContext context); AsyncClientStreamingCall Sum(Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)); + AsyncClientStreamingCall Sum(CallContext context); } // server-side interface @@ -68,28 +77,53 @@ namespace math { } public global::math.DivReply Div(global::math.DivArgs request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) { - var call = CreateCall(__ServiceName, __Method_Div, headers, deadline); - return Calls.BlockingUnaryCall(call, request, cancellationToken); + var call = CreateCall(__Method_Div, new CallContext(headers, deadline, cancellationToken)); + return Calls.BlockingUnaryCall(call, request); + } + public global::math.DivReply Div(global::math.DivArgs request, CallContext context) + { + var call = CreateCall(__Method_Div, context); + return Calls.BlockingUnaryCall(call, request); } public AsyncUnaryCall DivAsync(global::math.DivArgs request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) { - var call = CreateCall(__ServiceName, __Method_Div, headers, deadline); - return Calls.AsyncUnaryCall(call, request, cancellationToken); + var call = CreateCall(__Method_Div, new CallContext(headers, deadline, cancellationToken)); + return Calls.AsyncUnaryCall(call, request); + } + public AsyncUnaryCall DivAsync(global::math.DivArgs request, CallContext context) + { + var call = CreateCall(__Method_Div, context); + return Calls.AsyncUnaryCall(call, request); } public AsyncDuplexStreamingCall DivMany(Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) { - var call = CreateCall(__ServiceName, __Method_DivMany, headers, deadline); - return Calls.AsyncDuplexStreamingCall(call, cancellationToken); + var call = CreateCall(__Method_DivMany, new CallContext(headers, deadline, cancellationToken)); + return Calls.AsyncDuplexStreamingCall(call); + } + public AsyncDuplexStreamingCall DivMany(CallContext context) + { + var call = CreateCall(__Method_DivMany, context); + return Calls.AsyncDuplexStreamingCall(call); } public AsyncServerStreamingCall Fib(global::math.FibArgs request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) { - var call = CreateCall(__ServiceName, __Method_Fib, headers, deadline); - return Calls.AsyncServerStreamingCall(call, request, cancellationToken); + var call = CreateCall(__Method_Fib, new CallContext(headers, deadline, cancellationToken)); + return Calls.AsyncServerStreamingCall(call, request); + } + public AsyncServerStreamingCall Fib(global::math.FibArgs request, CallContext context) + { + var call = CreateCall(__Method_Fib, context); + return Calls.AsyncServerStreamingCall(call, request); } public AsyncClientStreamingCall Sum(Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) { - var call = CreateCall(__ServiceName, __Method_Sum, headers, deadline); - return Calls.AsyncClientStreamingCall(call, cancellationToken); + var call = CreateCall(__Method_Sum, new CallContext(headers, deadline, cancellationToken)); + return Calls.AsyncClientStreamingCall(call); + } + public AsyncClientStreamingCall Sum(CallContext context) + { + var call = CreateCall(__Method_Sum, context); + return Calls.AsyncClientStreamingCall(call); } } diff --git a/src/csharp/Grpc.HealthCheck/HealthGrpc.cs b/src/csharp/Grpc.HealthCheck/HealthGrpc.cs index 892cdb3f042..76078a851db 100644 --- a/src/csharp/Grpc.HealthCheck/HealthGrpc.cs +++ b/src/csharp/Grpc.HealthCheck/HealthGrpc.cs @@ -17,6 +17,7 @@ namespace Grpc.Health.V1Alpha { static readonly Method __Method_Check = new Method( MethodType.Unary, + __ServiceName, "Check", __Marshaller_HealthCheckRequest, __Marshaller_HealthCheckResponse); @@ -25,7 +26,9 @@ namespace Grpc.Health.V1Alpha { public interface IHealthClient { global::Grpc.Health.V1Alpha.HealthCheckResponse Check(global::Grpc.Health.V1Alpha.HealthCheckRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)); + global::Grpc.Health.V1Alpha.HealthCheckResponse Check(global::Grpc.Health.V1Alpha.HealthCheckRequest request, CallContext context); AsyncUnaryCall CheckAsync(global::Grpc.Health.V1Alpha.HealthCheckRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)); + AsyncUnaryCall CheckAsync(global::Grpc.Health.V1Alpha.HealthCheckRequest request, CallContext context); } // server-side interface @@ -42,13 +45,23 @@ namespace Grpc.Health.V1Alpha { } public global::Grpc.Health.V1Alpha.HealthCheckResponse Check(global::Grpc.Health.V1Alpha.HealthCheckRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) { - var call = CreateCall(__ServiceName, __Method_Check, headers, deadline); - return Calls.BlockingUnaryCall(call, request, cancellationToken); + var call = CreateCall(__Method_Check, new CallContext(headers, deadline, cancellationToken)); + return Calls.BlockingUnaryCall(call, request); + } + public global::Grpc.Health.V1Alpha.HealthCheckResponse Check(global::Grpc.Health.V1Alpha.HealthCheckRequest request, CallContext context) + { + var call = CreateCall(__Method_Check, context); + return Calls.BlockingUnaryCall(call, request); } public AsyncUnaryCall CheckAsync(global::Grpc.Health.V1Alpha.HealthCheckRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) { - var call = CreateCall(__ServiceName, __Method_Check, headers, deadline); - return Calls.AsyncUnaryCall(call, request, cancellationToken); + var call = CreateCall(__Method_Check, new CallContext(headers, deadline, cancellationToken)); + return Calls.AsyncUnaryCall(call, request); + } + public AsyncUnaryCall CheckAsync(global::Grpc.Health.V1Alpha.HealthCheckRequest request, CallContext context) + { + var call = CreateCall(__Method_Check, context); + return Calls.AsyncUnaryCall(call, request); } } diff --git a/src/csharp/Grpc.IntegrationTesting/TestGrpc.cs b/src/csharp/Grpc.IntegrationTesting/TestGrpc.cs index ddcd0c29585..ee539548f7a 100644 --- a/src/csharp/Grpc.IntegrationTesting/TestGrpc.cs +++ b/src/csharp/Grpc.IntegrationTesting/TestGrpc.cs @@ -22,36 +22,42 @@ namespace grpc.testing { static readonly Method __Method_EmptyCall = new Method( MethodType.Unary, + __ServiceName, "EmptyCall", __Marshaller_Empty, __Marshaller_Empty); static readonly Method __Method_UnaryCall = new Method( MethodType.Unary, + __ServiceName, "UnaryCall", __Marshaller_SimpleRequest, __Marshaller_SimpleResponse); static readonly Method __Method_StreamingOutputCall = new Method( MethodType.ServerStreaming, + __ServiceName, "StreamingOutputCall", __Marshaller_StreamingOutputCallRequest, __Marshaller_StreamingOutputCallResponse); static readonly Method __Method_StreamingInputCall = new Method( MethodType.ClientStreaming, + __ServiceName, "StreamingInputCall", __Marshaller_StreamingInputCallRequest, __Marshaller_StreamingInputCallResponse); static readonly Method __Method_FullDuplexCall = new Method( MethodType.DuplexStreaming, + __ServiceName, "FullDuplexCall", __Marshaller_StreamingOutputCallRequest, __Marshaller_StreamingOutputCallResponse); static readonly Method __Method_HalfDuplexCall = new Method( MethodType.DuplexStreaming, + __ServiceName, "HalfDuplexCall", __Marshaller_StreamingOutputCallRequest, __Marshaller_StreamingOutputCallResponse); @@ -60,13 +66,21 @@ namespace grpc.testing { public interface ITestServiceClient { global::grpc.testing.Empty EmptyCall(global::grpc.testing.Empty request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)); + global::grpc.testing.Empty EmptyCall(global::grpc.testing.Empty request, CallContext context); AsyncUnaryCall EmptyCallAsync(global::grpc.testing.Empty request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)); + AsyncUnaryCall EmptyCallAsync(global::grpc.testing.Empty request, CallContext context); global::grpc.testing.SimpleResponse UnaryCall(global::grpc.testing.SimpleRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)); + global::grpc.testing.SimpleResponse UnaryCall(global::grpc.testing.SimpleRequest request, CallContext context); AsyncUnaryCall UnaryCallAsync(global::grpc.testing.SimpleRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)); + AsyncUnaryCall UnaryCallAsync(global::grpc.testing.SimpleRequest request, CallContext context); AsyncServerStreamingCall StreamingOutputCall(global::grpc.testing.StreamingOutputCallRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)); + AsyncServerStreamingCall StreamingOutputCall(global::grpc.testing.StreamingOutputCallRequest request, CallContext context); AsyncClientStreamingCall StreamingInputCall(Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)); + AsyncClientStreamingCall StreamingInputCall(CallContext context); AsyncDuplexStreamingCall FullDuplexCall(Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)); + AsyncDuplexStreamingCall FullDuplexCall(CallContext context); AsyncDuplexStreamingCall HalfDuplexCall(Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)); + AsyncDuplexStreamingCall HalfDuplexCall(CallContext context); } // server-side interface @@ -88,43 +102,83 @@ namespace grpc.testing { } public global::grpc.testing.Empty EmptyCall(global::grpc.testing.Empty request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) { - var call = CreateCall(__ServiceName, __Method_EmptyCall, headers, deadline); - return Calls.BlockingUnaryCall(call, request, cancellationToken); + var call = CreateCall(__Method_EmptyCall, new CallContext(headers, deadline, cancellationToken)); + return Calls.BlockingUnaryCall(call, request); + } + public global::grpc.testing.Empty EmptyCall(global::grpc.testing.Empty request, CallContext context) + { + var call = CreateCall(__Method_EmptyCall, context); + return Calls.BlockingUnaryCall(call, request); } public AsyncUnaryCall EmptyCallAsync(global::grpc.testing.Empty request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) { - var call = CreateCall(__ServiceName, __Method_EmptyCall, headers, deadline); - return Calls.AsyncUnaryCall(call, request, cancellationToken); + var call = CreateCall(__Method_EmptyCall, new CallContext(headers, deadline, cancellationToken)); + return Calls.AsyncUnaryCall(call, request); + } + public AsyncUnaryCall EmptyCallAsync(global::grpc.testing.Empty request, CallContext context) + { + var call = CreateCall(__Method_EmptyCall, context); + return Calls.AsyncUnaryCall(call, request); } public global::grpc.testing.SimpleResponse UnaryCall(global::grpc.testing.SimpleRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) { - var call = CreateCall(__ServiceName, __Method_UnaryCall, headers, deadline); - return Calls.BlockingUnaryCall(call, request, cancellationToken); + var call = CreateCall(__Method_UnaryCall, new CallContext(headers, deadline, cancellationToken)); + return Calls.BlockingUnaryCall(call, request); + } + public global::grpc.testing.SimpleResponse UnaryCall(global::grpc.testing.SimpleRequest request, CallContext context) + { + var call = CreateCall(__Method_UnaryCall, context); + return Calls.BlockingUnaryCall(call, request); } public AsyncUnaryCall UnaryCallAsync(global::grpc.testing.SimpleRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) { - var call = CreateCall(__ServiceName, __Method_UnaryCall, headers, deadline); - return Calls.AsyncUnaryCall(call, request, cancellationToken); + var call = CreateCall(__Method_UnaryCall, new CallContext(headers, deadline, cancellationToken)); + return Calls.AsyncUnaryCall(call, request); + } + public AsyncUnaryCall UnaryCallAsync(global::grpc.testing.SimpleRequest request, CallContext context) + { + var call = CreateCall(__Method_UnaryCall, context); + return Calls.AsyncUnaryCall(call, request); } public AsyncServerStreamingCall StreamingOutputCall(global::grpc.testing.StreamingOutputCallRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) { - var call = CreateCall(__ServiceName, __Method_StreamingOutputCall, headers, deadline); - return Calls.AsyncServerStreamingCall(call, request, cancellationToken); + var call = CreateCall(__Method_StreamingOutputCall, new CallContext(headers, deadline, cancellationToken)); + return Calls.AsyncServerStreamingCall(call, request); + } + public AsyncServerStreamingCall StreamingOutputCall(global::grpc.testing.StreamingOutputCallRequest request, CallContext context) + { + var call = CreateCall(__Method_StreamingOutputCall, context); + return Calls.AsyncServerStreamingCall(call, request); } public AsyncClientStreamingCall StreamingInputCall(Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) { - var call = CreateCall(__ServiceName, __Method_StreamingInputCall, headers, deadline); - return Calls.AsyncClientStreamingCall(call, cancellationToken); + var call = CreateCall(__Method_StreamingInputCall, new CallContext(headers, deadline, cancellationToken)); + return Calls.AsyncClientStreamingCall(call); + } + public AsyncClientStreamingCall StreamingInputCall(CallContext context) + { + var call = CreateCall(__Method_StreamingInputCall, context); + return Calls.AsyncClientStreamingCall(call); } public AsyncDuplexStreamingCall FullDuplexCall(Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) { - var call = CreateCall(__ServiceName, __Method_FullDuplexCall, headers, deadline); - return Calls.AsyncDuplexStreamingCall(call, cancellationToken); + var call = CreateCall(__Method_FullDuplexCall, new CallContext(headers, deadline, cancellationToken)); + return Calls.AsyncDuplexStreamingCall(call); + } + public AsyncDuplexStreamingCall FullDuplexCall(CallContext context) + { + var call = CreateCall(__Method_FullDuplexCall, context); + return Calls.AsyncDuplexStreamingCall(call); } public AsyncDuplexStreamingCall HalfDuplexCall(Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) { - var call = CreateCall(__ServiceName, __Method_HalfDuplexCall, headers, deadline); - return Calls.AsyncDuplexStreamingCall(call, cancellationToken); + var call = CreateCall(__Method_HalfDuplexCall, new CallContext(headers, deadline, cancellationToken)); + return Calls.AsyncDuplexStreamingCall(call); + } + public AsyncDuplexStreamingCall HalfDuplexCall(CallContext context) + { + var call = CreateCall(__Method_HalfDuplexCall, context); + return Calls.AsyncDuplexStreamingCall(call); } }