Merge pull request #17837 from JunTaoLuo/master

Allow passing null implementation to generated BindService overload using ServiceBinderBase
pull/17890/head
Jan Tattermusch 6 years ago committed by GitHub
commit 81a99b3650
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 30
      src/compiler/csharp_generator.cc
  2. 16
      src/csharp/Grpc.Examples/MathGrpc.cs
  3. 12
      src/csharp/Grpc.HealthCheck/HealthGrpc.cs
  4. 18
      src/csharp/Grpc.IntegrationTesting/BenchmarkServiceGrpc.cs
  5. 10
      src/csharp/Grpc.IntegrationTesting/Control.cs
  6. 1
      src/csharp/Grpc.IntegrationTesting/Empty.cs
  7. 8
      src/csharp/Grpc.IntegrationTesting/EmptyServiceGrpc.cs
  8. 14
      src/csharp/Grpc.IntegrationTesting/MetricsGrpc.cs
  9. 10
      src/csharp/Grpc.IntegrationTesting/ReportQpsScenarioServiceGrpc.cs
  10. 34
      src/csharp/Grpc.IntegrationTesting/TestGrpc.cs
  11. 16
      src/csharp/Grpc.IntegrationTesting/WorkerServiceGrpc.cs
  12. 10
      src/csharp/Grpc.Reflection/ReflectionGrpc.cs

@ -199,6 +199,21 @@ std::string GetCSharpMethodType(MethodType method_type) {
return "";
}
std::string GetCSharpServerMethodType(MethodType method_type) {
switch (method_type) {
case METHODTYPE_NO_STREAMING:
return "grpc::UnaryServerMethod";
case METHODTYPE_CLIENT_STREAMING:
return "grpc::ClientStreamingServerMethod";
case METHODTYPE_SERVER_STREAMING:
return "grpc::ServerStreamingServerMethod";
case METHODTYPE_BIDI_STREAMING:
return "grpc::DuplexStreamingServerMethod";
}
GOOGLE_LOG(FATAL) << "Can't get here.";
return "";
}
std::string GetServiceNameFieldName() { return "__ServiceName"; }
std::string GetMarshallerFieldName(const Descriptor* message) {
@ -612,8 +627,9 @@ void GenerateBindServiceMethod(Printer* out, const ServiceDescriptor* service) {
void GenerateBindServiceWithBinderMethod(Printer* out,
const ServiceDescriptor* service) {
out->Print(
"/// <summary>Register service method implementations with a service "
"binder. Useful when customizing the service binding logic.\n"
"/// <summary>Register service method with a service "
"binder with or without implementation. Useful when customizing the "
"service binding logic.\n"
"/// Note: this method is part of an experimental API that can change or "
"be "
"removed without any prior notice.</summary>\n");
@ -635,9 +651,13 @@ void GenerateBindServiceWithBinderMethod(Printer* out,
for (int i = 0; i < service->method_count(); i++) {
const MethodDescriptor* method = service->method(i);
out->Print(
"serviceBinder.AddMethod($methodfield$, serviceImpl.$methodname$);\n",
"methodfield", GetMethodFieldName(method), "methodname",
method->name());
"serviceBinder.AddMethod($methodfield$, serviceImpl == null ? null : "
"new $servermethodtype$<$inputtype$, $outputtype$>("
"serviceImpl.$methodname$));\n",
"methodfield", GetMethodFieldName(method), "servermethodtype",
GetCSharpServerMethodType(GetMethodType(method)), "inputtype",
GetClassName(method->input_type()), "outputtype",
GetClassName(method->output_type()), "methodname", method->name());
}
out->Outdent();

@ -4,13 +4,13 @@
// </auto-generated>
// Original file comments:
// Copyright 2015 gRPC authors.
//
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//
// http://www.apache.org/licenses/LICENSE-2.0
//
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@ -287,16 +287,16 @@ namespace Math {
.AddMethod(__Method_Sum, serviceImpl.Sum).Build();
}
/// <summary>Register service method implementations with a service binder. Useful when customizing the service binding logic.
/// <summary>Register service method with a service binder with or without implementation. Useful when customizing the service binding logic.
/// Note: this method is part of an experimental API that can change or be removed without any prior notice.</summary>
/// <param name="serviceBinder">Service methods will be bound by calling <c>AddMethod</c> on this object.</param>
/// <param name="serviceImpl">An object implementing the server-side handling logic.</param>
public static void BindService(grpc::ServiceBinderBase serviceBinder, MathBase serviceImpl)
{
serviceBinder.AddMethod(__Method_Div, serviceImpl.Div);
serviceBinder.AddMethod(__Method_DivMany, serviceImpl.DivMany);
serviceBinder.AddMethod(__Method_Fib, serviceImpl.Fib);
serviceBinder.AddMethod(__Method_Sum, serviceImpl.Sum);
serviceBinder.AddMethod(__Method_Div, serviceImpl == null ? null : new grpc::UnaryServerMethod<global::Math.DivArgs, global::Math.DivReply>(serviceImpl.Div));
serviceBinder.AddMethod(__Method_DivMany, serviceImpl == null ? null : new grpc::DuplexStreamingServerMethod<global::Math.DivArgs, global::Math.DivReply>(serviceImpl.DivMany));
serviceBinder.AddMethod(__Method_Fib, serviceImpl == null ? null : new grpc::ServerStreamingServerMethod<global::Math.FibArgs, global::Math.Num>(serviceImpl.Fib));
serviceBinder.AddMethod(__Method_Sum, serviceImpl == null ? null : new grpc::ClientStreamingServerMethod<global::Math.Num, global::Math.Num>(serviceImpl.Sum));
}
}

@ -4,13 +4,13 @@
// </auto-generated>
// Original file comments:
// Copyright 2015 The gRPC Authors
//
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//
// http://www.apache.org/licenses/LICENSE-2.0
//
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@ -233,14 +233,14 @@ namespace Grpc.Health.V1 {
.AddMethod(__Method_Watch, serviceImpl.Watch).Build();
}
/// <summary>Register service method implementations with a service binder. Useful when customizing the service binding logic.
/// <summary>Register service method with a service binder with or without implementation. Useful when customizing the service binding logic.
/// Note: this method is part of an experimental API that can change or be removed without any prior notice.</summary>
/// <param name="serviceBinder">Service methods will be bound by calling <c>AddMethod</c> on this object.</param>
/// <param name="serviceImpl">An object implementing the server-side handling logic.</param>
public static void BindService(grpc::ServiceBinderBase serviceBinder, HealthBase serviceImpl)
{
serviceBinder.AddMethod(__Method_Check, serviceImpl.Check);
serviceBinder.AddMethod(__Method_Watch, serviceImpl.Watch);
serviceBinder.AddMethod(__Method_Check, serviceImpl == null ? null : new grpc::UnaryServerMethod<global::Grpc.Health.V1.HealthCheckRequest, global::Grpc.Health.V1.HealthCheckResponse>(serviceImpl.Check));
serviceBinder.AddMethod(__Method_Watch, serviceImpl == null ? null : new grpc::ServerStreamingServerMethod<global::Grpc.Health.V1.HealthCheckRequest, global::Grpc.Health.V1.HealthCheckResponse>(serviceImpl.Watch));
}
}

@ -4,13 +4,13 @@
// </auto-generated>
// Original file comments:
// Copyright 2015 gRPC authors.
//
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//
// http://www.apache.org/licenses/LICENSE-2.0
//
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@ -324,17 +324,17 @@ namespace Grpc.Testing {
.AddMethod(__Method_StreamingBothWays, serviceImpl.StreamingBothWays).Build();
}
/// <summary>Register service method implementations with a service binder. Useful when customizing the service binding logic.
/// <summary>Register service method with a service binder with or without implementation. Useful when customizing the service binding logic.
/// Note: this method is part of an experimental API that can change or be removed without any prior notice.</summary>
/// <param name="serviceBinder">Service methods will be bound by calling <c>AddMethod</c> on this object.</param>
/// <param name="serviceImpl">An object implementing the server-side handling logic.</param>
public static void BindService(grpc::ServiceBinderBase serviceBinder, BenchmarkServiceBase serviceImpl)
{
serviceBinder.AddMethod(__Method_UnaryCall, serviceImpl.UnaryCall);
serviceBinder.AddMethod(__Method_StreamingCall, serviceImpl.StreamingCall);
serviceBinder.AddMethod(__Method_StreamingFromClient, serviceImpl.StreamingFromClient);
serviceBinder.AddMethod(__Method_StreamingFromServer, serviceImpl.StreamingFromServer);
serviceBinder.AddMethod(__Method_StreamingBothWays, serviceImpl.StreamingBothWays);
serviceBinder.AddMethod(__Method_UnaryCall, serviceImpl == null ? null : new grpc::UnaryServerMethod<global::Grpc.Testing.SimpleRequest, global::Grpc.Testing.SimpleResponse>(serviceImpl.UnaryCall));
serviceBinder.AddMethod(__Method_StreamingCall, serviceImpl == null ? null : new grpc::DuplexStreamingServerMethod<global::Grpc.Testing.SimpleRequest, global::Grpc.Testing.SimpleResponse>(serviceImpl.StreamingCall));
serviceBinder.AddMethod(__Method_StreamingFromClient, serviceImpl == null ? null : new grpc::ClientStreamingServerMethod<global::Grpc.Testing.SimpleRequest, global::Grpc.Testing.SimpleResponse>(serviceImpl.StreamingFromClient));
serviceBinder.AddMethod(__Method_StreamingFromServer, serviceImpl == null ? null : new grpc::ServerStreamingServerMethod<global::Grpc.Testing.SimpleRequest, global::Grpc.Testing.SimpleResponse>(serviceImpl.StreamingFromServer));
serviceBinder.AddMethod(__Method_StreamingBothWays, serviceImpl == null ? null : new grpc::DuplexStreamingServerMethod<global::Grpc.Testing.SimpleRequest, global::Grpc.Testing.SimpleResponse>(serviceImpl.StreamingBothWays));
}
}

@ -96,12 +96,13 @@ namespace Grpc.Testing {
"GAcgAygIEhYKDnNlcnZlcl9zdWNjZXNzGAggAygIEjkKD3JlcXVlc3RfcmVz",
"dWx0cxgJIAMoCzIgLmdycGMudGVzdGluZy5SZXF1ZXN0UmVzdWx0Q291bnQq",
"VgoKQ2xpZW50VHlwZRIPCgtTWU5DX0NMSUVOVBAAEhAKDEFTWU5DX0NMSUVO",
"VBABEhAKDE9USEVSX0NMSUVOVBACEhMKD0NBTExCQUNLX0NMSUVOVBADKlsK",
"VBABEhAKDE9USEVSX0NMSUVOVBACEhMKD0NBTExCQUNLX0NMSUVOVBADKnAK",
"ClNlcnZlclR5cGUSDwoLU1lOQ19TRVJWRVIQABIQCgxBU1lOQ19TRVJWRVIQ",
"ARIYChRBU1lOQ19HRU5FUklDX1NFUlZFUhACEhAKDE9USEVSX1NFUlZFUhAD",
"KnIKB1JwY1R5cGUSCQoFVU5BUlkQABINCglTVFJFQU1JTkcQARIZChVTVFJF",
"QU1JTkdfRlJPTV9DTElFTlQQAhIZChVTVFJFQU1JTkdfRlJPTV9TRVJWRVIQ",
"AxIXChNTVFJFQU1JTkdfQk9USF9XQVlTEARiBnByb3RvMw=="));
"EhMKD0NBTExCQUNLX1NFUlZFUhAEKnIKB1JwY1R5cGUSCQoFVU5BUlkQABIN",
"CglTVFJFQU1JTkcQARIZChVTVFJFQU1JTkdfRlJPTV9DTElFTlQQAhIZChVT",
"VFJFQU1JTkdfRlJPTV9TRVJWRVIQAxIXChNTVFJFQU1JTkdfQk9USF9XQVlT",
"EARiBnByb3RvMw=="));
descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
new pbr::FileDescriptor[] { global::Grpc.Testing.PayloadsReflection.Descriptor, global::Grpc.Testing.StatsReflection.Descriptor, },
new pbr::GeneratedClrTypeInfo(new[] {typeof(global::Grpc.Testing.ClientType), typeof(global::Grpc.Testing.ServerType), typeof(global::Grpc.Testing.RpcType), }, new pbr::GeneratedClrTypeInfo[] {
@ -152,6 +153,7 @@ namespace Grpc.Testing {
/// used for some language-specific variants
/// </summary>
[pbr::OriginalName("OTHER_SERVER")] OtherServer = 3,
[pbr::OriginalName("CALLBACK_SERVER")] CallbackServer = 4,
}
public enum RpcType {

@ -44,6 +44,7 @@ namespace Grpc.Testing {
/// service Foo {
/// rpc Bar (grpc.testing.Empty) returns (grpc.testing.Empty) { };
/// };
///
/// </summary>
public sealed partial class Empty : pb::IMessage<Empty> {
private static readonly pb::MessageParser<Empty> _parser = new pb::MessageParser<Empty>(() => new Empty());

@ -4,13 +4,13 @@
// </auto-generated>
// Original file comments:
// Copyright 2018 gRPC authors.
//
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//
// http://www.apache.org/licenses/LICENSE-2.0
//
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@ -80,7 +80,7 @@ namespace Grpc.Testing {
return grpc::ServerServiceDefinition.CreateBuilder().Build();
}
/// <summary>Register service method implementations with a service binder. Useful when customizing the service binding logic.
/// <summary>Register service method with a service binder with or without implementation. Useful when customizing the service binding logic.
/// Note: this method is part of an experimental API that can change or be removed without any prior notice.</summary>
/// <param name="serviceBinder">Service methods will be bound by calling <c>AddMethod</c> on this object.</param>
/// <param name="serviceImpl">An object implementing the server-side handling logic.</param>

@ -4,13 +4,13 @@
// </auto-generated>
// Original file comments:
// Copyright 2015-2016 gRPC authors.
//
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//
// http://www.apache.org/licenses/LICENSE-2.0
//
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@ -19,7 +19,7 @@
//
// Contains the definitions for a metrics service and the type of metrics
// exposed by the service.
//
//
// Currently, 'Gauge' (i.e a metric that represents the measured value of
// something at an instant of time) is the only metric type supported by the
// service.
@ -193,14 +193,14 @@ namespace Grpc.Testing {
.AddMethod(__Method_GetGauge, serviceImpl.GetGauge).Build();
}
/// <summary>Register service method implementations with a service binder. Useful when customizing the service binding logic.
/// <summary>Register service method with a service binder with or without implementation. Useful when customizing the service binding logic.
/// Note: this method is part of an experimental API that can change or be removed without any prior notice.</summary>
/// <param name="serviceBinder">Service methods will be bound by calling <c>AddMethod</c> on this object.</param>
/// <param name="serviceImpl">An object implementing the server-side handling logic.</param>
public static void BindService(grpc::ServiceBinderBase serviceBinder, MetricsServiceBase serviceImpl)
{
serviceBinder.AddMethod(__Method_GetAllGauges, serviceImpl.GetAllGauges);
serviceBinder.AddMethod(__Method_GetGauge, serviceImpl.GetGauge);
serviceBinder.AddMethod(__Method_GetAllGauges, serviceImpl == null ? null : new grpc::ServerStreamingServerMethod<global::Grpc.Testing.EmptyMessage, global::Grpc.Testing.GaugeResponse>(serviceImpl.GetAllGauges));
serviceBinder.AddMethod(__Method_GetGauge, serviceImpl == null ? null : new grpc::UnaryServerMethod<global::Grpc.Testing.GaugeRequest, global::Grpc.Testing.GaugeResponse>(serviceImpl.GetGauge));
}
}

@ -4,13 +4,13 @@
// </auto-generated>
// Original file comments:
// Copyright 2015 gRPC authors.
//
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//
// http://www.apache.org/licenses/LICENSE-2.0
//
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@ -143,13 +143,13 @@ namespace Grpc.Testing {
.AddMethod(__Method_ReportScenario, serviceImpl.ReportScenario).Build();
}
/// <summary>Register service method implementations with a service binder. Useful when customizing the service binding logic.
/// <summary>Register service method with a service binder with or without implementation. Useful when customizing the service binding logic.
/// Note: this method is part of an experimental API that can change or be removed without any prior notice.</summary>
/// <param name="serviceBinder">Service methods will be bound by calling <c>AddMethod</c> on this object.</param>
/// <param name="serviceImpl">An object implementing the server-side handling logic.</param>
public static void BindService(grpc::ServiceBinderBase serviceBinder, ReportQpsScenarioServiceBase serviceImpl)
{
serviceBinder.AddMethod(__Method_ReportScenario, serviceImpl.ReportScenario);
serviceBinder.AddMethod(__Method_ReportScenario, serviceImpl == null ? null : new grpc::UnaryServerMethod<global::Grpc.Testing.ScenarioResult, global::Grpc.Testing.Void>(serviceImpl.ReportScenario));
}
}

@ -4,13 +4,13 @@
// </auto-generated>
// Original file comments:
// Copyright 2015-2016 gRPC authors.
//
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//
// http://www.apache.org/licenses/LICENSE-2.0
//
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@ -539,20 +539,20 @@ namespace Grpc.Testing {
.AddMethod(__Method_UnimplementedCall, serviceImpl.UnimplementedCall).Build();
}
/// <summary>Register service method implementations with a service binder. Useful when customizing the service binding logic.
/// <summary>Register service method with a service binder with or without implementation. Useful when customizing the service binding logic.
/// Note: this method is part of an experimental API that can change or be removed without any prior notice.</summary>
/// <param name="serviceBinder">Service methods will be bound by calling <c>AddMethod</c> on this object.</param>
/// <param name="serviceImpl">An object implementing the server-side handling logic.</param>
public static void BindService(grpc::ServiceBinderBase serviceBinder, TestServiceBase serviceImpl)
{
serviceBinder.AddMethod(__Method_EmptyCall, serviceImpl.EmptyCall);
serviceBinder.AddMethod(__Method_UnaryCall, serviceImpl.UnaryCall);
serviceBinder.AddMethod(__Method_CacheableUnaryCall, serviceImpl.CacheableUnaryCall);
serviceBinder.AddMethod(__Method_StreamingOutputCall, serviceImpl.StreamingOutputCall);
serviceBinder.AddMethod(__Method_StreamingInputCall, serviceImpl.StreamingInputCall);
serviceBinder.AddMethod(__Method_FullDuplexCall, serviceImpl.FullDuplexCall);
serviceBinder.AddMethod(__Method_HalfDuplexCall, serviceImpl.HalfDuplexCall);
serviceBinder.AddMethod(__Method_UnimplementedCall, serviceImpl.UnimplementedCall);
serviceBinder.AddMethod(__Method_EmptyCall, serviceImpl == null ? null : new grpc::UnaryServerMethod<global::Grpc.Testing.Empty, global::Grpc.Testing.Empty>(serviceImpl.EmptyCall));
serviceBinder.AddMethod(__Method_UnaryCall, serviceImpl == null ? null : new grpc::UnaryServerMethod<global::Grpc.Testing.SimpleRequest, global::Grpc.Testing.SimpleResponse>(serviceImpl.UnaryCall));
serviceBinder.AddMethod(__Method_CacheableUnaryCall, serviceImpl == null ? null : new grpc::UnaryServerMethod<global::Grpc.Testing.SimpleRequest, global::Grpc.Testing.SimpleResponse>(serviceImpl.CacheableUnaryCall));
serviceBinder.AddMethod(__Method_StreamingOutputCall, serviceImpl == null ? null : new grpc::ServerStreamingServerMethod<global::Grpc.Testing.StreamingOutputCallRequest, global::Grpc.Testing.StreamingOutputCallResponse>(serviceImpl.StreamingOutputCall));
serviceBinder.AddMethod(__Method_StreamingInputCall, serviceImpl == null ? null : new grpc::ClientStreamingServerMethod<global::Grpc.Testing.StreamingInputCallRequest, global::Grpc.Testing.StreamingInputCallResponse>(serviceImpl.StreamingInputCall));
serviceBinder.AddMethod(__Method_FullDuplexCall, serviceImpl == null ? null : new grpc::DuplexStreamingServerMethod<global::Grpc.Testing.StreamingOutputCallRequest, global::Grpc.Testing.StreamingOutputCallResponse>(serviceImpl.FullDuplexCall));
serviceBinder.AddMethod(__Method_HalfDuplexCall, serviceImpl == null ? null : new grpc::DuplexStreamingServerMethod<global::Grpc.Testing.StreamingOutputCallRequest, global::Grpc.Testing.StreamingOutputCallResponse>(serviceImpl.HalfDuplexCall));
serviceBinder.AddMethod(__Method_UnimplementedCall, serviceImpl == null ? null : new grpc::UnaryServerMethod<global::Grpc.Testing.Empty, global::Grpc.Testing.Empty>(serviceImpl.UnimplementedCall));
}
}
@ -677,13 +677,13 @@ namespace Grpc.Testing {
.AddMethod(__Method_UnimplementedCall, serviceImpl.UnimplementedCall).Build();
}
/// <summary>Register service method implementations with a service binder. Useful when customizing the service binding logic.
/// <summary>Register service method with a service binder with or without implementation. Useful when customizing the service binding logic.
/// Note: this method is part of an experimental API that can change or be removed without any prior notice.</summary>
/// <param name="serviceBinder">Service methods will be bound by calling <c>AddMethod</c> on this object.</param>
/// <param name="serviceImpl">An object implementing the server-side handling logic.</param>
public static void BindService(grpc::ServiceBinderBase serviceBinder, UnimplementedServiceBase serviceImpl)
{
serviceBinder.AddMethod(__Method_UnimplementedCall, serviceImpl.UnimplementedCall);
serviceBinder.AddMethod(__Method_UnimplementedCall, serviceImpl == null ? null : new grpc::UnaryServerMethod<global::Grpc.Testing.Empty, global::Grpc.Testing.Empty>(serviceImpl.UnimplementedCall));
}
}
@ -804,14 +804,14 @@ namespace Grpc.Testing {
.AddMethod(__Method_Stop, serviceImpl.Stop).Build();
}
/// <summary>Register service method implementations with a service binder. Useful when customizing the service binding logic.
/// <summary>Register service method with a service binder with or without implementation. Useful when customizing the service binding logic.
/// Note: this method is part of an experimental API that can change or be removed without any prior notice.</summary>
/// <param name="serviceBinder">Service methods will be bound by calling <c>AddMethod</c> on this object.</param>
/// <param name="serviceImpl">An object implementing the server-side handling logic.</param>
public static void BindService(grpc::ServiceBinderBase serviceBinder, ReconnectServiceBase serviceImpl)
{
serviceBinder.AddMethod(__Method_Start, serviceImpl.Start);
serviceBinder.AddMethod(__Method_Stop, serviceImpl.Stop);
serviceBinder.AddMethod(__Method_Start, serviceImpl == null ? null : new grpc::UnaryServerMethod<global::Grpc.Testing.ReconnectParams, global::Grpc.Testing.Empty>(serviceImpl.Start));
serviceBinder.AddMethod(__Method_Stop, serviceImpl == null ? null : new grpc::UnaryServerMethod<global::Grpc.Testing.Empty, global::Grpc.Testing.ReconnectInfo>(serviceImpl.Stop));
}
}

@ -4,13 +4,13 @@
// </auto-generated>
// Original file comments:
// Copyright 2015 gRPC authors.
//
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//
// http://www.apache.org/licenses/LICENSE-2.0
//
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@ -321,16 +321,16 @@ namespace Grpc.Testing {
.AddMethod(__Method_QuitWorker, serviceImpl.QuitWorker).Build();
}
/// <summary>Register service method implementations with a service binder. Useful when customizing the service binding logic.
/// <summary>Register service method with a service binder with or without implementation. Useful when customizing the service binding logic.
/// Note: this method is part of an experimental API that can change or be removed without any prior notice.</summary>
/// <param name="serviceBinder">Service methods will be bound by calling <c>AddMethod</c> on this object.</param>
/// <param name="serviceImpl">An object implementing the server-side handling logic.</param>
public static void BindService(grpc::ServiceBinderBase serviceBinder, WorkerServiceBase serviceImpl)
{
serviceBinder.AddMethod(__Method_RunServer, serviceImpl.RunServer);
serviceBinder.AddMethod(__Method_RunClient, serviceImpl.RunClient);
serviceBinder.AddMethod(__Method_CoreCount, serviceImpl.CoreCount);
serviceBinder.AddMethod(__Method_QuitWorker, serviceImpl.QuitWorker);
serviceBinder.AddMethod(__Method_RunServer, serviceImpl == null ? null : new grpc::DuplexStreamingServerMethod<global::Grpc.Testing.ServerArgs, global::Grpc.Testing.ServerStatus>(serviceImpl.RunServer));
serviceBinder.AddMethod(__Method_RunClient, serviceImpl == null ? null : new grpc::DuplexStreamingServerMethod<global::Grpc.Testing.ClientArgs, global::Grpc.Testing.ClientStatus>(serviceImpl.RunClient));
serviceBinder.AddMethod(__Method_CoreCount, serviceImpl == null ? null : new grpc::UnaryServerMethod<global::Grpc.Testing.CoreRequest, global::Grpc.Testing.CoreResponse>(serviceImpl.CoreCount));
serviceBinder.AddMethod(__Method_QuitWorker, serviceImpl == null ? null : new grpc::UnaryServerMethod<global::Grpc.Testing.Void, global::Grpc.Testing.Void>(serviceImpl.QuitWorker));
}
}

@ -4,13 +4,13 @@
// </auto-generated>
// Original file comments:
// Copyright 2016 gRPC authors.
//
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//
// http://www.apache.org/licenses/LICENSE-2.0
//
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@ -123,13 +123,13 @@ namespace Grpc.Reflection.V1Alpha {
.AddMethod(__Method_ServerReflectionInfo, serviceImpl.ServerReflectionInfo).Build();
}
/// <summary>Register service method implementations with a service binder. Useful when customizing the service binding logic.
/// <summary>Register service method with a service binder with or without implementation. Useful when customizing the service binding logic.
/// Note: this method is part of an experimental API that can change or be removed without any prior notice.</summary>
/// <param name="serviceBinder">Service methods will be bound by calling <c>AddMethod</c> on this object.</param>
/// <param name="serviceImpl">An object implementing the server-side handling logic.</param>
public static void BindService(grpc::ServiceBinderBase serviceBinder, ServerReflectionBase serviceImpl)
{
serviceBinder.AddMethod(__Method_ServerReflectionInfo, serviceImpl.ServerReflectionInfo);
serviceBinder.AddMethod(__Method_ServerReflectionInfo, serviceImpl == null ? null : new grpc::DuplexStreamingServerMethod<global::Grpc.Reflection.V1Alpha.ServerReflectionRequest, global::Grpc.Reflection.V1Alpha.ServerReflectionResponse>(serviceImpl.ServerReflectionInfo));
}
}

Loading…
Cancel
Save