From 41f9f33e372fab01dd06888d3728abd6cd5101a5 Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Wed, 20 May 2015 08:52:00 -0700 Subject: [PATCH 1/2] use full name when referencing protobuf messages --- src/compiler/csharp_generator.cc | 77 ++++++++++++++++++++++---------- src/compiler/generator_helpers.h | 11 +++-- 2 files changed, 61 insertions(+), 27 deletions(-) diff --git a/src/compiler/csharp_generator.cc b/src/compiler/csharp_generator.cc index 82dd06bcec4..5dd078b303b 100644 --- a/src/compiler/csharp_generator.cc +++ b/src/compiler/csharp_generator.cc @@ -51,20 +51,49 @@ using grpc_generator::METHODTYPE_NO_STREAMING; using grpc_generator::METHODTYPE_CLIENT_STREAMING; using grpc_generator::METHODTYPE_SERVER_STREAMING; using grpc_generator::METHODTYPE_BIDI_STREAMING; +using grpc_generator::StringReplace; using std::map; using std::vector; namespace grpc_csharp_generator { namespace { -std::string GetCSharpNamespace(const FileDescriptor* file) { - // TODO(jtattermusch): this should be based on csharp_namespace option +// TODO(jtattermusch): make GetFileNamespace part of libprotoc public API. +// NOTE: Implementation needs to match exactly to GetFileNamespace +// defined in csharp_helpers.h in protoc csharp plugin. +// We cannot reference it directly because google3 protobufs +// don't have a csharp protoc plugin. +std::string GetFileNamespace(const FileDescriptor* file) { + if (file->options().has_csharp_namespace()) { + return file->options().csharp_namespace(); + } return file->package(); } -std::string GetMessageType(const Descriptor* message) { - // TODO(jtattermusch): this has to match with C# protobuf generator - return message->name(); +std::string ToCSharpName(const std::string& name, const FileDescriptor* file) { + std::string result = GetFileNamespace(file); + if (result != "") { + result += '.'; + } + std::string classname; + if (file->package().empty()) { + classname = name; + } else { + // Strip the proto package from full_name since we've replaced it with + // the C# namespace. + classname = name.substr(file->package().size() + 1); + } + result += StringReplace(classname, ".", ".Types.", false); + return "global::" + result; +} + +// TODO(jtattermusch): make GetClassName part of libprotoc public API. +// NOTE: Implementation needs to match exactly to GetClassName +// defined in csharp_helpers.h in protoc csharp plugin. +// We cannot reference it directly because google3 protobufs +// don't have a csharp protoc plugin. +std::string GetClassName(const Descriptor* message) { + return ToCSharpName(message->full_name(), message->file()); } std::string GetServiceClassName(const ServiceDescriptor* service) { @@ -114,22 +143,22 @@ std::string GetMethodRequestParamMaybe(const MethodDescriptor *method) { if (method->client_streaming()) { return ""; } - return GetMessageType(method->input_type()) + " request, "; + return GetClassName(method->input_type()) + " request, "; } std::string GetMethodReturnTypeClient(const MethodDescriptor *method) { switch (GetMethodType(method)) { case METHODTYPE_NO_STREAMING: - return "Task<" + GetMessageType(method->output_type()) + ">"; + return "Task<" + GetClassName(method->output_type()) + ">"; case METHODTYPE_CLIENT_STREAMING: - return "AsyncClientStreamingCall<" + GetMessageType(method->input_type()) - + ", " + GetMessageType(method->output_type()) + ">"; + return "AsyncClientStreamingCall<" + GetClassName(method->input_type()) + + ", " + GetClassName(method->output_type()) + ">"; case METHODTYPE_SERVER_STREAMING: - return "AsyncServerStreamingCall<" + GetMessageType(method->output_type()) + return "AsyncServerStreamingCall<" + GetClassName(method->output_type()) + ">"; case METHODTYPE_BIDI_STREAMING: - return "AsyncDuplexStreamingCall<" + GetMessageType(method->input_type()) - + ", " + GetMessageType(method->output_type()) + ">"; + return "AsyncDuplexStreamingCall<" + GetClassName(method->input_type()) + + ", " + GetClassName(method->output_type()) + ">"; } GOOGLE_LOG(FATAL)<< "Can't get here."; return ""; @@ -139,10 +168,10 @@ std::string GetMethodRequestParamServer(const MethodDescriptor *method) { switch (GetMethodType(method)) { case METHODTYPE_NO_STREAMING: case METHODTYPE_SERVER_STREAMING: - return GetMessageType(method->input_type()) + " request"; + return GetClassName(method->input_type()) + " request"; case METHODTYPE_CLIENT_STREAMING: case METHODTYPE_BIDI_STREAMING: - return "IAsyncStreamReader<" + GetMessageType(method->input_type()) + return "IAsyncStreamReader<" + GetClassName(method->input_type()) + "> requestStream"; } GOOGLE_LOG(FATAL)<< "Can't get here."; @@ -153,7 +182,7 @@ std::string GetMethodReturnTypeServer(const MethodDescriptor *method) { switch (GetMethodType(method)) { case METHODTYPE_NO_STREAMING: case METHODTYPE_CLIENT_STREAMING: - return "Task<" + GetMessageType(method->output_type()) + ">"; + return "Task<" + GetClassName(method->output_type()) + ">"; case METHODTYPE_SERVER_STREAMING: case METHODTYPE_BIDI_STREAMING: return "Task"; @@ -169,7 +198,7 @@ std::string GetMethodResponseStreamMaybe(const MethodDescriptor *method) { return ""; case METHODTYPE_SERVER_STREAMING: case METHODTYPE_BIDI_STREAMING: - return ", IServerStreamWriter<" + GetMessageType(method->output_type()) + return ", IServerStreamWriter<" + GetClassName(method->output_type()) + "> responseStream"; } GOOGLE_LOG(FATAL)<< "Can't get here."; @@ -202,7 +231,7 @@ void GenerateMarshallerFields(Printer* out, const ServiceDescriptor *service) { out->Print( "static readonly Marshaller<$type$> $fieldname$ = Marshallers.Create((arg) => arg.ToByteArray(), $type$.ParseFrom);\n", "fieldname", GetMarshallerFieldName(message), "type", - GetMessageType(message)); + GetClassName(message)); } out->Print("\n"); } @@ -211,8 +240,8 @@ void GenerateStaticMethodField(Printer* out, const MethodDescriptor *method) { out->Print( "static readonly Method<$request$, $response$> $fieldname$ = new Method<$request$, $response$>(\n", "fieldname", GetMethodFieldName(method), "request", - GetMessageType(method->input_type()), "response", - GetMessageType(method->output_type())); + GetClassName(method->input_type()), "response", + GetClassName(method->output_type())); out->Indent(); out->Indent(); out->Print("$methodtype$,\n", "methodtype", @@ -242,8 +271,8 @@ void GenerateClientInterface(Printer* out, const ServiceDescriptor *service) { out->Print( "$response$ $methodname$($request$ request, CancellationToken token = default(CancellationToken));\n", "methodname", method->name(), "request", - GetMessageType(method->input_type()), "response", - GetMessageType(method->output_type())); + GetClassName(method->input_type()), "response", + GetClassName(method->output_type())); } std::string method_name = method->name(); @@ -310,8 +339,8 @@ void GenerateClientStub(Printer* out, const ServiceDescriptor *service) { out->Print( "public $response$ $methodname$($request$ request, CancellationToken token = default(CancellationToken))\n", "methodname", method->name(), "request", - GetMessageType(method->input_type()), "response", - GetMessageType(method->output_type())); + GetClassName(method->input_type()), "response", + GetClassName(method->output_type())); out->Print("{\n"); out->Indent(); out->Print("var call = CreateCall($servicenamefield$, $methodfield$);\n", @@ -466,7 +495,7 @@ grpc::string GetServices(const FileDescriptor *file) { // TODO(jtattermusch): add using for protobuf message classes out.Print("\n"); - out.Print("namespace $namespace$ {\n", "namespace", GetCSharpNamespace(file)); + out.Print("namespace $namespace$ {\n", "namespace", GetFileNamespace(file)); out.Indent(); for (int i = 0; i < file->service_count(); i++) { GenerateService(&out, file->service(i)); diff --git a/src/compiler/generator_helpers.h b/src/compiler/generator_helpers.h index 7ce4ec526c9..373dd7f013a 100644 --- a/src/compiler/generator_helpers.h +++ b/src/compiler/generator_helpers.h @@ -60,21 +60,26 @@ inline grpc::string StripProto(grpc::string filename) { } inline grpc::string StringReplace(grpc::string str, const grpc::string &from, - const grpc::string &to) { + const grpc::string &to, bool replace_all) { size_t pos = 0; - for (;;) { + do { pos = str.find(from, pos); if (pos == grpc::string::npos) { break; } str.replace(pos, from.length(), to); pos += to.length(); - } + } while(replace_all); return str; } +inline grpc::string StringReplace(grpc::string str, const grpc::string &from, + const grpc::string &to) { + return StringReplace(str, from, to, true); +} + inline std::vector tokenize(const grpc::string &input, const grpc::string &delimiters) { std::vector tokens; From 3fffe60ef87966c050a56369097d883a57f25e2f Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Wed, 20 May 2015 08:56:24 -0700 Subject: [PATCH 2/2] regenerate service stubs --- src/csharp/Grpc.Examples/MathGrpc.cs | 44 ++++++------ .../Grpc.IntegrationTesting/TestGrpc.cs | 70 +++++++++---------- 2 files changed, 57 insertions(+), 57 deletions(-) diff --git a/src/csharp/Grpc.Examples/MathGrpc.cs b/src/csharp/Grpc.Examples/MathGrpc.cs index 2546fd220de..b9efc44e8c1 100644 --- a/src/csharp/Grpc.Examples/MathGrpc.cs +++ b/src/csharp/Grpc.Examples/MathGrpc.cs @@ -12,30 +12,30 @@ namespace math { { static readonly string __ServiceName = "math.Math"; - static readonly Marshaller __Marshaller_DivArgs = Marshallers.Create((arg) => arg.ToByteArray(), DivArgs.ParseFrom); - static readonly Marshaller __Marshaller_DivReply = Marshallers.Create((arg) => arg.ToByteArray(), DivReply.ParseFrom); - static readonly Marshaller __Marshaller_FibArgs = Marshallers.Create((arg) => arg.ToByteArray(), FibArgs.ParseFrom); - static readonly Marshaller __Marshaller_Num = Marshallers.Create((arg) => arg.ToByteArray(), Num.ParseFrom); + static readonly Marshaller __Marshaller_DivArgs = Marshallers.Create((arg) => arg.ToByteArray(), global::math.DivArgs.ParseFrom); + static readonly Marshaller __Marshaller_DivReply = Marshallers.Create((arg) => arg.ToByteArray(), global::math.DivReply.ParseFrom); + static readonly Marshaller __Marshaller_FibArgs = Marshallers.Create((arg) => arg.ToByteArray(), global::math.FibArgs.ParseFrom); + static readonly Marshaller __Marshaller_Num = Marshallers.Create((arg) => arg.ToByteArray(), global::math.Num.ParseFrom); - static readonly Method __Method_Div = new Method( + static readonly Method __Method_Div = new Method( MethodType.Unary, "Div", __Marshaller_DivArgs, __Marshaller_DivReply); - static readonly Method __Method_DivMany = new Method( + static readonly Method __Method_DivMany = new Method( MethodType.DuplexStreaming, "DivMany", __Marshaller_DivArgs, __Marshaller_DivReply); - static readonly Method __Method_Fib = new Method( + static readonly Method __Method_Fib = new Method( MethodType.ServerStreaming, "Fib", __Marshaller_FibArgs, __Marshaller_Num); - static readonly Method __Method_Sum = new Method( + static readonly Method __Method_Sum = new Method( MethodType.ClientStreaming, "Sum", __Marshaller_Num, @@ -44,20 +44,20 @@ namespace math { // client-side stub interface public interface IMathClient { - DivReply Div(DivArgs request, CancellationToken token = default(CancellationToken)); - Task DivAsync(DivArgs request, CancellationToken token = default(CancellationToken)); - AsyncDuplexStreamingCall DivMany(CancellationToken token = default(CancellationToken)); - AsyncServerStreamingCall Fib(FibArgs request, CancellationToken token = default(CancellationToken)); - AsyncClientStreamingCall Sum(CancellationToken token = default(CancellationToken)); + global::math.DivReply Div(global::math.DivArgs request, CancellationToken token = default(CancellationToken)); + Task DivAsync(global::math.DivArgs request, CancellationToken token = default(CancellationToken)); + AsyncDuplexStreamingCall DivMany(CancellationToken token = default(CancellationToken)); + AsyncServerStreamingCall Fib(global::math.FibArgs request, CancellationToken token = default(CancellationToken)); + AsyncClientStreamingCall Sum(CancellationToken token = default(CancellationToken)); } // server-side interface public interface IMath { - Task Div(ServerCallContext context, DivArgs request); - Task DivMany(ServerCallContext context, IAsyncStreamReader requestStream, IServerStreamWriter responseStream); - Task Fib(ServerCallContext context, FibArgs request, IServerStreamWriter responseStream); - Task Sum(ServerCallContext context, IAsyncStreamReader requestStream); + Task Div(ServerCallContext context, global::math.DivArgs request); + Task DivMany(ServerCallContext context, IAsyncStreamReader requestStream, IServerStreamWriter responseStream); + Task Fib(ServerCallContext context, global::math.FibArgs request, IServerStreamWriter responseStream); + Task Sum(ServerCallContext context, IAsyncStreamReader requestStream); } // client stub @@ -69,27 +69,27 @@ namespace math { public MathClient(Channel channel, StubConfiguration config) : base(channel, config) { } - public DivReply Div(DivArgs request, CancellationToken token = default(CancellationToken)) + public global::math.DivReply Div(global::math.DivArgs request, CancellationToken token = default(CancellationToken)) { var call = CreateCall(__ServiceName, __Method_Div); return Calls.BlockingUnaryCall(call, request, token); } - public Task DivAsync(DivArgs request, CancellationToken token = default(CancellationToken)) + public Task DivAsync(global::math.DivArgs request, CancellationToken token = default(CancellationToken)) { var call = CreateCall(__ServiceName, __Method_Div); return Calls.AsyncUnaryCall(call, request, token); } - public AsyncDuplexStreamingCall DivMany(CancellationToken token = default(CancellationToken)) + public AsyncDuplexStreamingCall DivMany(CancellationToken token = default(CancellationToken)) { var call = CreateCall(__ServiceName, __Method_DivMany); return Calls.AsyncDuplexStreamingCall(call, token); } - public AsyncServerStreamingCall Fib(FibArgs request, CancellationToken token = default(CancellationToken)) + public AsyncServerStreamingCall Fib(global::math.FibArgs request, CancellationToken token = default(CancellationToken)) { var call = CreateCall(__ServiceName, __Method_Fib); return Calls.AsyncServerStreamingCall(call, request, token); } - public AsyncClientStreamingCall Sum(CancellationToken token = default(CancellationToken)) + public AsyncClientStreamingCall Sum(CancellationToken token = default(CancellationToken)) { var call = CreateCall(__ServiceName, __Method_Sum); return Calls.AsyncClientStreamingCall(call, token); diff --git a/src/csharp/Grpc.IntegrationTesting/TestGrpc.cs b/src/csharp/Grpc.IntegrationTesting/TestGrpc.cs index 679aafb57a9..ee077f9f56f 100644 --- a/src/csharp/Grpc.IntegrationTesting/TestGrpc.cs +++ b/src/csharp/Grpc.IntegrationTesting/TestGrpc.cs @@ -12,45 +12,45 @@ namespace grpc.testing { { static readonly string __ServiceName = "grpc.testing.TestService"; - static readonly Marshaller __Marshaller_Empty = Marshallers.Create((arg) => arg.ToByteArray(), Empty.ParseFrom); - static readonly Marshaller __Marshaller_SimpleRequest = Marshallers.Create((arg) => arg.ToByteArray(), SimpleRequest.ParseFrom); - static readonly Marshaller __Marshaller_SimpleResponse = Marshallers.Create((arg) => arg.ToByteArray(), SimpleResponse.ParseFrom); - static readonly Marshaller __Marshaller_StreamingOutputCallRequest = Marshallers.Create((arg) => arg.ToByteArray(), StreamingOutputCallRequest.ParseFrom); - static readonly Marshaller __Marshaller_StreamingOutputCallResponse = Marshallers.Create((arg) => arg.ToByteArray(), StreamingOutputCallResponse.ParseFrom); - static readonly Marshaller __Marshaller_StreamingInputCallRequest = Marshallers.Create((arg) => arg.ToByteArray(), StreamingInputCallRequest.ParseFrom); - static readonly Marshaller __Marshaller_StreamingInputCallResponse = Marshallers.Create((arg) => arg.ToByteArray(), StreamingInputCallResponse.ParseFrom); + static readonly Marshaller __Marshaller_Empty = Marshallers.Create((arg) => arg.ToByteArray(), global::grpc.testing.Empty.ParseFrom); + static readonly Marshaller __Marshaller_SimpleRequest = Marshallers.Create((arg) => arg.ToByteArray(), global::grpc.testing.SimpleRequest.ParseFrom); + static readonly Marshaller __Marshaller_SimpleResponse = Marshallers.Create((arg) => arg.ToByteArray(), global::grpc.testing.SimpleResponse.ParseFrom); + static readonly Marshaller __Marshaller_StreamingOutputCallRequest = Marshallers.Create((arg) => arg.ToByteArray(), global::grpc.testing.StreamingOutputCallRequest.ParseFrom); + static readonly Marshaller __Marshaller_StreamingOutputCallResponse = Marshallers.Create((arg) => arg.ToByteArray(), global::grpc.testing.StreamingOutputCallResponse.ParseFrom); + static readonly Marshaller __Marshaller_StreamingInputCallRequest = Marshallers.Create((arg) => arg.ToByteArray(), global::grpc.testing.StreamingInputCallRequest.ParseFrom); + static readonly Marshaller __Marshaller_StreamingInputCallResponse = Marshallers.Create((arg) => arg.ToByteArray(), global::grpc.testing.StreamingInputCallResponse.ParseFrom); - static readonly Method __Method_EmptyCall = new Method( + static readonly Method __Method_EmptyCall = new Method( MethodType.Unary, "EmptyCall", __Marshaller_Empty, __Marshaller_Empty); - static readonly Method __Method_UnaryCall = new Method( + static readonly Method __Method_UnaryCall = new Method( MethodType.Unary, "UnaryCall", __Marshaller_SimpleRequest, __Marshaller_SimpleResponse); - static readonly Method __Method_StreamingOutputCall = new Method( + static readonly Method __Method_StreamingOutputCall = new Method( MethodType.ServerStreaming, "StreamingOutputCall", __Marshaller_StreamingOutputCallRequest, __Marshaller_StreamingOutputCallResponse); - static readonly Method __Method_StreamingInputCall = new Method( + static readonly Method __Method_StreamingInputCall = new Method( MethodType.ClientStreaming, "StreamingInputCall", __Marshaller_StreamingInputCallRequest, __Marshaller_StreamingInputCallResponse); - static readonly Method __Method_FullDuplexCall = new Method( + static readonly Method __Method_FullDuplexCall = new Method( MethodType.DuplexStreaming, "FullDuplexCall", __Marshaller_StreamingOutputCallRequest, __Marshaller_StreamingOutputCallResponse); - static readonly Method __Method_HalfDuplexCall = new Method( + static readonly Method __Method_HalfDuplexCall = new Method( MethodType.DuplexStreaming, "HalfDuplexCall", __Marshaller_StreamingOutputCallRequest, @@ -59,25 +59,25 @@ namespace grpc.testing { // client-side stub interface public interface ITestServiceClient { - Empty EmptyCall(Empty request, CancellationToken token = default(CancellationToken)); - Task EmptyCallAsync(Empty request, CancellationToken token = default(CancellationToken)); - SimpleResponse UnaryCall(SimpleRequest request, CancellationToken token = default(CancellationToken)); - Task UnaryCallAsync(SimpleRequest request, CancellationToken token = default(CancellationToken)); - AsyncServerStreamingCall StreamingOutputCall(StreamingOutputCallRequest request, CancellationToken token = default(CancellationToken)); - AsyncClientStreamingCall StreamingInputCall(CancellationToken token = default(CancellationToken)); - AsyncDuplexStreamingCall FullDuplexCall(CancellationToken token = default(CancellationToken)); - AsyncDuplexStreamingCall HalfDuplexCall(CancellationToken token = default(CancellationToken)); + global::grpc.testing.Empty EmptyCall(global::grpc.testing.Empty request, CancellationToken token = default(CancellationToken)); + Task EmptyCallAsync(global::grpc.testing.Empty request, CancellationToken token = default(CancellationToken)); + global::grpc.testing.SimpleResponse UnaryCall(global::grpc.testing.SimpleRequest request, CancellationToken token = default(CancellationToken)); + Task UnaryCallAsync(global::grpc.testing.SimpleRequest request, CancellationToken token = default(CancellationToken)); + AsyncServerStreamingCall StreamingOutputCall(global::grpc.testing.StreamingOutputCallRequest request, CancellationToken token = default(CancellationToken)); + AsyncClientStreamingCall StreamingInputCall(CancellationToken token = default(CancellationToken)); + AsyncDuplexStreamingCall FullDuplexCall(CancellationToken token = default(CancellationToken)); + AsyncDuplexStreamingCall HalfDuplexCall(CancellationToken token = default(CancellationToken)); } // server-side interface public interface ITestService { - Task EmptyCall(ServerCallContext context, Empty request); - Task UnaryCall(ServerCallContext context, SimpleRequest request); - Task StreamingOutputCall(ServerCallContext context, StreamingOutputCallRequest request, IServerStreamWriter responseStream); - Task StreamingInputCall(ServerCallContext context, IAsyncStreamReader requestStream); - Task FullDuplexCall(ServerCallContext context, IAsyncStreamReader requestStream, IServerStreamWriter responseStream); - Task HalfDuplexCall(ServerCallContext context, IAsyncStreamReader requestStream, IServerStreamWriter responseStream); + Task EmptyCall(ServerCallContext context, global::grpc.testing.Empty request); + Task UnaryCall(ServerCallContext context, global::grpc.testing.SimpleRequest request); + Task StreamingOutputCall(ServerCallContext context, global::grpc.testing.StreamingOutputCallRequest request, IServerStreamWriter responseStream); + Task StreamingInputCall(ServerCallContext context, IAsyncStreamReader requestStream); + Task FullDuplexCall(ServerCallContext context, IAsyncStreamReader requestStream, IServerStreamWriter responseStream); + Task HalfDuplexCall(ServerCallContext context, IAsyncStreamReader requestStream, IServerStreamWriter responseStream); } // client stub @@ -89,42 +89,42 @@ namespace grpc.testing { public TestServiceClient(Channel channel, StubConfiguration config) : base(channel, config) { } - public Empty EmptyCall(Empty request, CancellationToken token = default(CancellationToken)) + public global::grpc.testing.Empty EmptyCall(global::grpc.testing.Empty request, CancellationToken token = default(CancellationToken)) { var call = CreateCall(__ServiceName, __Method_EmptyCall); return Calls.BlockingUnaryCall(call, request, token); } - public Task EmptyCallAsync(Empty request, CancellationToken token = default(CancellationToken)) + public Task EmptyCallAsync(global::grpc.testing.Empty request, CancellationToken token = default(CancellationToken)) { var call = CreateCall(__ServiceName, __Method_EmptyCall); return Calls.AsyncUnaryCall(call, request, token); } - public SimpleResponse UnaryCall(SimpleRequest request, CancellationToken token = default(CancellationToken)) + public global::grpc.testing.SimpleResponse UnaryCall(global::grpc.testing.SimpleRequest request, CancellationToken token = default(CancellationToken)) { var call = CreateCall(__ServiceName, __Method_UnaryCall); return Calls.BlockingUnaryCall(call, request, token); } - public Task UnaryCallAsync(SimpleRequest request, CancellationToken token = default(CancellationToken)) + public Task UnaryCallAsync(global::grpc.testing.SimpleRequest request, CancellationToken token = default(CancellationToken)) { var call = CreateCall(__ServiceName, __Method_UnaryCall); return Calls.AsyncUnaryCall(call, request, token); } - public AsyncServerStreamingCall StreamingOutputCall(StreamingOutputCallRequest request, CancellationToken token = default(CancellationToken)) + public AsyncServerStreamingCall StreamingOutputCall(global::grpc.testing.StreamingOutputCallRequest request, CancellationToken token = default(CancellationToken)) { var call = CreateCall(__ServiceName, __Method_StreamingOutputCall); return Calls.AsyncServerStreamingCall(call, request, token); } - public AsyncClientStreamingCall StreamingInputCall(CancellationToken token = default(CancellationToken)) + public AsyncClientStreamingCall StreamingInputCall(CancellationToken token = default(CancellationToken)) { var call = CreateCall(__ServiceName, __Method_StreamingInputCall); return Calls.AsyncClientStreamingCall(call, token); } - public AsyncDuplexStreamingCall FullDuplexCall(CancellationToken token = default(CancellationToken)) + public AsyncDuplexStreamingCall FullDuplexCall(CancellationToken token = default(CancellationToken)) { var call = CreateCall(__ServiceName, __Method_FullDuplexCall); return Calls.AsyncDuplexStreamingCall(call, token); } - public AsyncDuplexStreamingCall HalfDuplexCall(CancellationToken token = default(CancellationToken)) + public AsyncDuplexStreamingCall HalfDuplexCall(CancellationToken token = default(CancellationToken)) { var call = CreateCall(__ServiceName, __Method_HalfDuplexCall); return Calls.AsyncDuplexStreamingCall(call, token);