Merge remote-tracking branch 'upstream/master' into spiffe1

pull/19778/head
Matthew Stevenson 6 years ago
commit a3dde11f68
  1. 2
      .github/ISSUE_TEMPLATE/bug_report.md
  2. 2
      .github/ISSUE_TEMPLATE/cleanup_request.md
  3. 2
      .github/ISSUE_TEMPLATE/feature_request.md
  4. 2
      .github/pull_request_template.md
  5. 3
      Makefile
  6. 6
      bazel/grpc_deps.bzl
  7. 3
      grpc.gyp
  8. 100
      src/compiler/csharp_generator.cc
  9. 2
      src/compiler/csharp_generator.h
  10. 7
      src/compiler/csharp_plugin.cc
  11. 63
      src/csharp/Grpc.Core.Api/LiteClientBase.cs
  12. 10
      src/csharp/Grpc.Core.Tests/TimeoutsTest.cs
  13. 4
      src/csharp/Grpc.Examples.Tests/MathClientServerTests.cs
  14. 759
      src/csharp/Grpc.Examples/MathWithProtocOptions.cs
  15. 208
      src/csharp/Grpc.Examples/MathWithProtocOptionsGrpc.cs
  16. 65
      src/csharp/Grpc.Examples/math_with_protoc_options.proto
  17. 3
      src/csharp/Grpc.IntegrationTesting/InteropClient.cs
  18. 137
      src/csharp/Grpc.IntegrationTesting/Messages.cs
  19. 2
      src/csharp/Grpc.Microbenchmarks/PingBenchmark.cs
  20. 2
      src/csharp/Grpc.Microbenchmarks/UnaryCallOverheadBenchmark.cs
  21. 11
      src/csharp/Grpc.Tools/build/_grpc/Grpc.CSharp.xml
  22. 3
      src/csharp/Grpc.Tools/build/_grpc/_Grpc.Tools.targets
  23. 2
      src/csharp/experimental/build_native_ext_for_ios.sh
  24. 2
      src/csharp/generate_proto_csharp.sh
  25. 4
      test/core/util/test_config.cc
  26. 3
      test/core/util/test_config.h
  27. 38
      test/cpp/end2end/async_end2end_test.cc
  28. 2
      third_party/benchmark
  29. 2
      tools/run_tests/sanity/check_submodules.sh

@ -2,7 +2,7 @@
name: Report a bug name: Report a bug
about: Create a report to help us improve about: Create a report to help us improve
labels: kind/bug, priority/P2 labels: kind/bug, priority/P2
assignees: mhaidrygoog assignees: nanahpang
--- ---

@ -2,7 +2,7 @@
name: Request a cleanup name: Request a cleanup
about: Suggest a cleanup in our repository about: Suggest a cleanup in our repository
labels: kind/internal cleanup labels: kind/internal cleanup
assignees: mhaidrygoog assignees: nanahpang
--- ---

@ -2,7 +2,7 @@
name: Request a feature name: Request a feature
about: Suggest an idea for this project about: Suggest an idea for this project
labels: kind/enhancement labels: kind/enhancement
assignees: mhaidrygoog assignees: nanahpang
--- ---

@ -8,4 +8,4 @@ If you know who should review your pull request, please remove the mentioning be
--> -->
@mhaidrygoog @nanahpang

@ -8034,8 +8034,11 @@ endif
LIBBENCHMARK_SRC = \ LIBBENCHMARK_SRC = \
third_party/benchmark/src/benchmark.cc \ third_party/benchmark/src/benchmark.cc \
third_party/benchmark/src/benchmark_api_internal.cc \
third_party/benchmark/src/benchmark_main.cc \ third_party/benchmark/src/benchmark_main.cc \
third_party/benchmark/src/benchmark_name.cc \
third_party/benchmark/src/benchmark_register.cc \ third_party/benchmark/src/benchmark_register.cc \
third_party/benchmark/src/benchmark_runner.cc \
third_party/benchmark/src/colorprint.cc \ third_party/benchmark/src/colorprint.cc \
third_party/benchmark/src/commandlineflags.cc \ third_party/benchmark/src/commandlineflags.cc \
third_party/benchmark/src/complexity.cc \ third_party/benchmark/src/complexity.cc \

@ -151,9 +151,9 @@ def grpc_deps():
if "com_github_google_benchmark" not in native.existing_rules(): if "com_github_google_benchmark" not in native.existing_rules():
http_archive( http_archive(
name = "com_github_google_benchmark", name = "com_github_google_benchmark",
sha256 = "c7682e9007ddfd94072647abab3e89ffd9084089460ae47d67060974467b58bf", sha256 = "f68aec93154d010324c05bcd8c5cc53468b87af88d87acb5ddcfaa1bba044837",
strip_prefix = "benchmark-e776aa0275e293707b6a0901e0e8d8a8a3679508", strip_prefix = "benchmark-090faecb454fbd6e6e17a75ef8146acb037118d4",
url = "https://github.com/google/benchmark/archive/e776aa0275e293707b6a0901e0e8d8a8a3679508.tar.gz", url = "https://github.com/google/benchmark/archive/090faecb454fbd6e6e17a75ef8146acb037118d4.tar.gz",
) )
if "com_github_cares_cares" not in native.existing_rules(): if "com_github_cares_cares" not in native.existing_rules():

@ -2272,8 +2272,11 @@
], ],
'sources': [ 'sources': [
'third_party/benchmark/src/benchmark.cc', 'third_party/benchmark/src/benchmark.cc',
'third_party/benchmark/src/benchmark_api_internal.cc',
'third_party/benchmark/src/benchmark_main.cc', 'third_party/benchmark/src/benchmark_main.cc',
'third_party/benchmark/src/benchmark_name.cc',
'third_party/benchmark/src/benchmark_register.cc', 'third_party/benchmark/src/benchmark_register.cc',
'third_party/benchmark/src/benchmark_runner.cc',
'third_party/benchmark/src/colorprint.cc', 'third_party/benchmark/src/colorprint.cc',
'third_party/benchmark/src/commandlineflags.cc', 'third_party/benchmark/src/commandlineflags.cc',
'third_party/benchmark/src/complexity.cc', 'third_party/benchmark/src/complexity.cc',

@ -414,34 +414,24 @@ void GenerateServerClass(Printer* out, const ServiceDescriptor* service) {
out->Print("\n"); out->Print("\n");
} }
void GenerateClientStub(Printer* out, const ServiceDescriptor* service, void GenerateClientStub(Printer* out, const ServiceDescriptor* service) {
bool lite_client) { out->Print("/// <summary>Client for $servicename$</summary>\n", "servicename",
if (!lite_client) { GetServiceClassName(service));
out->Print("/// <summary>Client for $servicename$</summary>\n", out->Print("public partial class $name$ : grpc::ClientBase<$name$>\n", "name",
"servicename", GetServiceClassName(service)); GetClientClassName(service));
out->Print("public partial class $name$ : grpc::ClientBase<$name$>\n",
"name", GetClientClassName(service));
} else {
out->Print("/// <summary>Lite client for $servicename$</summary>\n",
"servicename", GetServiceClassName(service));
out->Print("public partial class $name$ : grpc::LiteClientBase\n", "name",
GetClientClassName(service));
}
out->Print("{\n"); out->Print("{\n");
out->Indent(); out->Indent();
// constructors // constructors
if (!lite_client) { out->Print(
out->Print( "/// <summary>Creates a new client for $servicename$</summary>\n"
"/// <summary>Creates a new client for $servicename$</summary>\n" "/// <param name=\"channel\">The channel to use to make remote "
"/// <param name=\"channel\">The channel to use to make remote " "calls.</param>\n",
"calls.</param>\n", "servicename", GetServiceClassName(service));
"servicename", GetServiceClassName(service)); out->Print("public $name$(grpc::ChannelBase channel) : base(channel)\n",
out->Print("public $name$(grpc::ChannelBase channel) : base(channel)\n", "name", GetClientClassName(service));
"name", GetClientClassName(service)); out->Print("{\n");
out->Print("{\n"); out->Print("}\n");
out->Print("}\n");
}
out->Print( out->Print(
"/// <summary>Creates a new client for $servicename$ that uses a custom " "/// <summary>Creates a new client for $servicename$ that uses a custom "
"<c>CallInvoker</c>.</summary>\n" "<c>CallInvoker</c>.</summary>\n"
@ -460,20 +450,16 @@ void GenerateClientStub(Printer* out, const ServiceDescriptor* service,
GetClientClassName(service)); GetClientClassName(service));
out->Print("{\n"); out->Print("{\n");
out->Print("}\n"); out->Print("}\n");
if (!lite_client) { out->Print(
out->Print( "/// <summary>Protected constructor to allow creation of configured "
"/// <summary>Protected constructor to allow creation of configured " "clients.</summary>\n"
"clients.</summary>\n" "/// <param name=\"configuration\">The client configuration.</param>\n");
"/// <param name=\"configuration\">The client " out->Print(
"configuration.</param>\n"); "protected $name$(ClientBaseConfiguration configuration)"
out->Print( " : base(configuration)\n",
"protected $name$(ClientBaseConfiguration configuration)" "name", GetClientClassName(service));
" : base(configuration)\n", out->Print("{\n");
"name", GetClientClassName(service)); out->Print("}\n\n");
out->Print("{\n");
out->Print("}\n");
}
out->Print("\n");
for (int i = 0; i < service->method_count(); i++) { for (int i = 0; i < service->method_count(); i++) {
const MethodDescriptor* method = service->method(i); const MethodDescriptor* method = service->method(i);
@ -591,21 +577,19 @@ void GenerateClientStub(Printer* out, const ServiceDescriptor* service,
} }
// override NewInstance method // override NewInstance method
if (!lite_client) { out->Print(
out->Print( "/// <summary>Creates a new instance of client from given "
"/// <summary>Creates a new instance of client from given " "<c>ClientBaseConfiguration</c>.</summary>\n");
"<c>ClientBaseConfiguration</c>.</summary>\n"); out->Print(
out->Print( "protected override $name$ NewInstance(ClientBaseConfiguration "
"protected override $name$ NewInstance(ClientBaseConfiguration " "configuration)\n",
"configuration)\n", "name", GetClientClassName(service));
"name", GetClientClassName(service)); out->Print("{\n");
out->Print("{\n"); out->Indent();
out->Indent(); out->Print("return new $name$(configuration);\n", "name",
out->Print("return new $name$(configuration);\n", "name", GetClientClassName(service));
GetClientClassName(service)); out->Outdent();
out->Outdent(); out->Print("}\n");
out->Print("}\n");
}
out->Outdent(); out->Outdent();
out->Print("}\n"); out->Print("}\n");
@ -687,7 +671,7 @@ void GenerateBindServiceWithBinderMethod(Printer* out,
void GenerateService(Printer* out, const ServiceDescriptor* service, void GenerateService(Printer* out, const ServiceDescriptor* service,
bool generate_client, bool generate_server, bool generate_client, bool generate_server,
bool internal_access, bool lite_client) { bool internal_access) {
GenerateDocCommentBody(out, service); GenerateDocCommentBody(out, service);
out->Print("$access_level$ static partial class $classname$\n", out->Print("$access_level$ static partial class $classname$\n",
"access_level", GetAccessLevel(internal_access), "classname", "access_level", GetAccessLevel(internal_access), "classname",
@ -709,9 +693,8 @@ void GenerateService(Printer* out, const ServiceDescriptor* service,
GenerateServerClass(out, service); GenerateServerClass(out, service);
} }
if (generate_client) { if (generate_client) {
GenerateClientStub(out, service, lite_client); GenerateClientStub(out, service);
} }
if (generate_server) { if (generate_server) {
GenerateBindServiceMethod(out, service); GenerateBindServiceMethod(out, service);
GenerateBindServiceWithBinderMethod(out, service); GenerateBindServiceWithBinderMethod(out, service);
@ -724,8 +707,7 @@ void GenerateService(Printer* out, const ServiceDescriptor* service,
} // anonymous namespace } // anonymous namespace
grpc::string GetServices(const FileDescriptor* file, bool generate_client, grpc::string GetServices(const FileDescriptor* file, bool generate_client,
bool generate_server, bool internal_access, bool generate_server, bool internal_access) {
bool lite_client) {
grpc::string output; grpc::string output;
{ {
// Scope the output stream so it closes and finalizes output to the string. // Scope the output stream so it closes and finalizes output to the string.
@ -767,7 +749,7 @@ grpc::string GetServices(const FileDescriptor* file, bool generate_client,
} }
for (int i = 0; i < file->service_count(); i++) { for (int i = 0; i < file->service_count(); i++) {
GenerateService(&out, file->service(i), generate_client, generate_server, GenerateService(&out, file->service(i), generate_client, generate_server,
internal_access, lite_client); internal_access);
} }
if (file_namespace != "") { if (file_namespace != "") {
out.Outdent(); out.Outdent();

@ -27,7 +27,7 @@ namespace grpc_csharp_generator {
grpc::string GetServices(const grpc::protobuf::FileDescriptor* file, grpc::string GetServices(const grpc::protobuf::FileDescriptor* file,
bool generate_client, bool generate_server, bool generate_client, bool generate_server,
bool internal_access, bool lite_client); bool internal_access);
} // namespace grpc_csharp_generator } // namespace grpc_csharp_generator

@ -39,7 +39,6 @@ class CSharpGrpcGenerator : public grpc::protobuf::compiler::CodeGenerator {
bool generate_client = true; bool generate_client = true;
bool generate_server = true; bool generate_server = true;
bool internal_access = false; bool internal_access = false;
bool lite_client = false;
for (size_t i = 0; i < options.size(); i++) { for (size_t i = 0; i < options.size(); i++) {
if (options[i].first == "no_client") { if (options[i].first == "no_client") {
generate_client = false; generate_client = false;
@ -47,10 +46,6 @@ class CSharpGrpcGenerator : public grpc::protobuf::compiler::CodeGenerator {
generate_server = false; generate_server = false;
} else if (options[i].first == "internal_access") { } else if (options[i].first == "internal_access") {
internal_access = true; internal_access = true;
} else if (options[i].first == "lite_client") {
// will only be used if generate_client is true.
// NOTE: experimental option, can be removed in future release
lite_client = true;
} else { } else {
*error = "Unknown generator option: " + options[i].first; *error = "Unknown generator option: " + options[i].first;
return false; return false;
@ -58,7 +53,7 @@ class CSharpGrpcGenerator : public grpc::protobuf::compiler::CodeGenerator {
} }
grpc::string code = grpc_csharp_generator::GetServices( grpc::string code = grpc_csharp_generator::GetServices(
file, generate_client, generate_server, internal_access, lite_client); file, generate_client, generate_server, internal_access);
if (code.size() == 0) { if (code.size() == 0) {
return true; // don't generate a file if there are no services return true; // don't generate a file if there are no services
} }

@ -1,63 +0,0 @@
#region Copyright notice and license
// Copyright 2019 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.
// See the License for the specific language governing permissions and
// limitations under the License.
#endregion
using System;
using Grpc.Core.Internal;
using Grpc.Core.Utils;
namespace Grpc.Core
{
/// <summary>
/// Base class for lightweight client-side stubs.
/// All calls are invoked via a <c>CallInvoker</c>.
/// Lite client stubs have no configuration knobs, all configuration
/// is provided by decorating the call invoker.
/// Note: experimental API that can change or be removed without any prior notice.
/// </summary>
public abstract class LiteClientBase
{
readonly CallInvoker callInvoker;
/// <summary>
/// Initializes a new instance of <c>LiteClientBase</c> class that
/// throws <c>NotImplementedException</c> upon invocation of any RPC.
/// This constructor is only provided to allow creation of test doubles
/// for client classes (e.g. mocking requires a parameterless constructor).
/// </summary>
protected LiteClientBase() : this(new UnimplementedCallInvoker())
{
}
/// <summary>
/// Initializes a new instance of <c>ClientBase</c> class.
/// </summary>
/// <param name="callInvoker">The <c>CallInvoker</c> for remote call invocation.</param>
public LiteClientBase(CallInvoker callInvoker)
{
this.callInvoker = GrpcPreconditions.CheckNotNull(callInvoker, nameof(callInvoker));
}
/// <summary>
/// Gets the call invoker.
/// </summary>
protected CallInvoker CallInvoker
{
get { return this.callInvoker; }
}
}
}

@ -96,8 +96,7 @@ namespace Grpc.Core.Tests
}); });
var ex = Assert.Throws<RpcException>(() => Calls.BlockingUnaryCall(helper.CreateUnaryCall(new CallOptions(deadline: DateTime.MinValue)), "abc")); var ex = Assert.Throws<RpcException>(() => Calls.BlockingUnaryCall(helper.CreateUnaryCall(new CallOptions(deadline: DateTime.MinValue)), "abc"));
// We can't guarantee the status code always DeadlineExceeded. See issue #2685. Assert.AreEqual(StatusCode.DeadlineExceeded, ex.Status.StatusCode);
Assert.Contains(ex.Status.StatusCode, new[] { StatusCode.DeadlineExceeded, StatusCode.Internal });
} }
[Test] [Test]
@ -110,8 +109,7 @@ namespace Grpc.Core.Tests
}); });
var ex = Assert.Throws<RpcException>(() => Calls.BlockingUnaryCall(helper.CreateUnaryCall(new CallOptions(deadline: DateTime.UtcNow.Add(TimeSpan.FromSeconds(5)))), "abc")); var ex = Assert.Throws<RpcException>(() => Calls.BlockingUnaryCall(helper.CreateUnaryCall(new CallOptions(deadline: DateTime.UtcNow.Add(TimeSpan.FromSeconds(5)))), "abc"));
// We can't guarantee the status code always DeadlineExceeded. See issue #2685. Assert.AreEqual(StatusCode.DeadlineExceeded, ex.Status.StatusCode);
Assert.Contains(ex.Status.StatusCode, new[] { StatusCode.DeadlineExceeded, StatusCode.Internal });
} }
[Test] [Test]
@ -130,9 +128,7 @@ namespace Grpc.Core.Tests
}); });
var ex = Assert.Throws<RpcException>(() => Calls.BlockingUnaryCall(helper.CreateUnaryCall(new CallOptions(deadline: DateTime.UtcNow.Add(TimeSpan.FromSeconds(5)))), "abc")); var ex = Assert.Throws<RpcException>(() => Calls.BlockingUnaryCall(helper.CreateUnaryCall(new CallOptions(deadline: DateTime.UtcNow.Add(TimeSpan.FromSeconds(5)))), "abc"));
// We can't guarantee the status code always DeadlineExceeded. See issue #2685. Assert.AreEqual(StatusCode.DeadlineExceeded, ex.Status.StatusCode);
Assert.Contains(ex.Status.StatusCode, new[] { StatusCode.DeadlineExceeded, StatusCode.Internal });
Assert.IsTrue(await serverReceivedCancellationTcs.Task); Assert.IsTrue(await serverReceivedCancellationTcs.Task);
} }
} }

@ -136,9 +136,7 @@ namespace Math.Tests
deadline: DateTime.UtcNow.AddMilliseconds(500))) deadline: DateTime.UtcNow.AddMilliseconds(500)))
{ {
var ex = Assert.ThrowsAsync<RpcException>(async () => await call.ResponseStream.ToListAsync()); var ex = Assert.ThrowsAsync<RpcException>(async () => await call.ResponseStream.ToListAsync());
Assert.AreEqual(StatusCode.DeadlineExceeded, ex.Status.StatusCode);
// We can't guarantee the status code always DeadlineExceeded. See issue #2685.
Assert.Contains(ex.Status.StatusCode, new[] { StatusCode.DeadlineExceeded, StatusCode.Internal });
} }
} }

@ -1,759 +0,0 @@
// <auto-generated>
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: math_with_protoc_options.proto
// </auto-generated>
#pragma warning disable 1591, 0612, 3021
#region Designer generated code
using pb = global::Google.Protobuf;
using pbc = global::Google.Protobuf.Collections;
using pbr = global::Google.Protobuf.Reflection;
using scg = global::System.Collections.Generic;
namespace MathWithProtocOptions {
/// <summary>Holder for reflection information generated from math_with_protoc_options.proto</summary>
public static partial class MathWithProtocOptionsReflection {
#region Descriptor
/// <summary>File descriptor for math_with_protoc_options.proto</summary>
public static pbr::FileDescriptor Descriptor {
get { return descriptor; }
}
private static pbr::FileDescriptor descriptor;
static MathWithProtocOptionsReflection() {
byte[] descriptorData = global::System.Convert.FromBase64String(
string.Concat(
"Ch5tYXRoX3dpdGhfcHJvdG9jX29wdGlvbnMucHJvdG8SGG1hdGhfd2l0aF9w",
"cm90b2Nfb3B0aW9ucyIsCgdEaXZBcmdzEhAKCGRpdmlkZW5kGAEgASgDEg8K",
"B2Rpdmlzb3IYAiABKAMiLwoIRGl2UmVwbHkSEAoIcXVvdGllbnQYASABKAMS",
"EQoJcmVtYWluZGVyGAIgASgDIhgKB0ZpYkFyZ3MSDQoFbGltaXQYASABKAMi",
"EgoDTnVtEgsKA251bRgBIAEoAyIZCghGaWJSZXBseRINCgVjb3VudBgBIAEo",
"AzLEAgoETWF0aBJOCgNEaXYSIS5tYXRoX3dpdGhfcHJvdG9jX29wdGlvbnMu",
"RGl2QXJncxoiLm1hdGhfd2l0aF9wcm90b2Nfb3B0aW9ucy5EaXZSZXBseSIA",
"ElYKB0Rpdk1hbnkSIS5tYXRoX3dpdGhfcHJvdG9jX29wdGlvbnMuRGl2QXJn",
"cxoiLm1hdGhfd2l0aF9wcm90b2Nfb3B0aW9ucy5EaXZSZXBseSIAKAEwARJL",
"CgNGaWISIS5tYXRoX3dpdGhfcHJvdG9jX29wdGlvbnMuRmliQXJncxodLm1h",
"dGhfd2l0aF9wcm90b2Nfb3B0aW9ucy5OdW0iADABEkcKA1N1bRIdLm1hdGhf",
"d2l0aF9wcm90b2Nfb3B0aW9ucy5OdW0aHS5tYXRoX3dpdGhfcHJvdG9jX29w",
"dGlvbnMuTnVtIgAoAWIGcHJvdG8z"));
descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
new pbr::FileDescriptor[] { },
new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] {
new pbr::GeneratedClrTypeInfo(typeof(global::MathWithProtocOptions.DivArgs), global::MathWithProtocOptions.DivArgs.Parser, new[]{ "Dividend", "Divisor" }, null, null, null),
new pbr::GeneratedClrTypeInfo(typeof(global::MathWithProtocOptions.DivReply), global::MathWithProtocOptions.DivReply.Parser, new[]{ "Quotient", "Remainder" }, null, null, null),
new pbr::GeneratedClrTypeInfo(typeof(global::MathWithProtocOptions.FibArgs), global::MathWithProtocOptions.FibArgs.Parser, new[]{ "Limit" }, null, null, null),
new pbr::GeneratedClrTypeInfo(typeof(global::MathWithProtocOptions.Num), global::MathWithProtocOptions.Num.Parser, new[]{ "Num_" }, null, null, null),
new pbr::GeneratedClrTypeInfo(typeof(global::MathWithProtocOptions.FibReply), global::MathWithProtocOptions.FibReply.Parser, new[]{ "Count" }, null, null, null)
}));
}
#endregion
}
#region Messages
public sealed partial class DivArgs : pb::IMessage<DivArgs> {
private static readonly pb::MessageParser<DivArgs> _parser = new pb::MessageParser<DivArgs>(() => new DivArgs());
private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<DivArgs> Parser { get { return _parser; } }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pbr::MessageDescriptor Descriptor {
get { return global::MathWithProtocOptions.MathWithProtocOptionsReflection.Descriptor.MessageTypes[0]; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
pbr::MessageDescriptor pb::IMessage.Descriptor {
get { return Descriptor; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public DivArgs() {
OnConstruction();
}
partial void OnConstruction();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public DivArgs(DivArgs other) : this() {
dividend_ = other.dividend_;
divisor_ = other.divisor_;
_unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public DivArgs Clone() {
return new DivArgs(this);
}
/// <summary>Field number for the "dividend" field.</summary>
public const int DividendFieldNumber = 1;
private long dividend_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public long Dividend {
get { return dividend_; }
set {
dividend_ = value;
}
}
/// <summary>Field number for the "divisor" field.</summary>
public const int DivisorFieldNumber = 2;
private long divisor_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public long Divisor {
get { return divisor_; }
set {
divisor_ = value;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override bool Equals(object other) {
return Equals(other as DivArgs);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool Equals(DivArgs other) {
if (ReferenceEquals(other, null)) {
return false;
}
if (ReferenceEquals(other, this)) {
return true;
}
if (Dividend != other.Dividend) return false;
if (Divisor != other.Divisor) return false;
return Equals(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
if (Dividend != 0L) hash ^= Dividend.GetHashCode();
if (Divisor != 0L) hash ^= Divisor.GetHashCode();
if (_unknownFields != null) {
hash ^= _unknownFields.GetHashCode();
}
return hash;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override string ToString() {
return pb::JsonFormatter.ToDiagnosticString(this);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) {
if (Dividend != 0L) {
output.WriteRawTag(8);
output.WriteInt64(Dividend);
}
if (Divisor != 0L) {
output.WriteRawTag(16);
output.WriteInt64(Divisor);
}
if (_unknownFields != null) {
_unknownFields.WriteTo(output);
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() {
int size = 0;
if (Dividend != 0L) {
size += 1 + pb::CodedOutputStream.ComputeInt64Size(Dividend);
}
if (Divisor != 0L) {
size += 1 + pb::CodedOutputStream.ComputeInt64Size(Divisor);
}
if (_unknownFields != null) {
size += _unknownFields.CalculateSize();
}
return size;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(DivArgs other) {
if (other == null) {
return;
}
if (other.Dividend != 0L) {
Dividend = other.Dividend;
}
if (other.Divisor != 0L) {
Divisor = other.Divisor;
}
_unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
_unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
break;
case 8: {
Dividend = input.ReadInt64();
break;
}
case 16: {
Divisor = input.ReadInt64();
break;
}
}
}
}
}
public sealed partial class DivReply : pb::IMessage<DivReply> {
private static readonly pb::MessageParser<DivReply> _parser = new pb::MessageParser<DivReply>(() => new DivReply());
private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<DivReply> Parser { get { return _parser; } }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pbr::MessageDescriptor Descriptor {
get { return global::MathWithProtocOptions.MathWithProtocOptionsReflection.Descriptor.MessageTypes[1]; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
pbr::MessageDescriptor pb::IMessage.Descriptor {
get { return Descriptor; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public DivReply() {
OnConstruction();
}
partial void OnConstruction();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public DivReply(DivReply other) : this() {
quotient_ = other.quotient_;
remainder_ = other.remainder_;
_unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public DivReply Clone() {
return new DivReply(this);
}
/// <summary>Field number for the "quotient" field.</summary>
public const int QuotientFieldNumber = 1;
private long quotient_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public long Quotient {
get { return quotient_; }
set {
quotient_ = value;
}
}
/// <summary>Field number for the "remainder" field.</summary>
public const int RemainderFieldNumber = 2;
private long remainder_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public long Remainder {
get { return remainder_; }
set {
remainder_ = value;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override bool Equals(object other) {
return Equals(other as DivReply);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool Equals(DivReply other) {
if (ReferenceEquals(other, null)) {
return false;
}
if (ReferenceEquals(other, this)) {
return true;
}
if (Quotient != other.Quotient) return false;
if (Remainder != other.Remainder) return false;
return Equals(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
if (Quotient != 0L) hash ^= Quotient.GetHashCode();
if (Remainder != 0L) hash ^= Remainder.GetHashCode();
if (_unknownFields != null) {
hash ^= _unknownFields.GetHashCode();
}
return hash;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override string ToString() {
return pb::JsonFormatter.ToDiagnosticString(this);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) {
if (Quotient != 0L) {
output.WriteRawTag(8);
output.WriteInt64(Quotient);
}
if (Remainder != 0L) {
output.WriteRawTag(16);
output.WriteInt64(Remainder);
}
if (_unknownFields != null) {
_unknownFields.WriteTo(output);
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() {
int size = 0;
if (Quotient != 0L) {
size += 1 + pb::CodedOutputStream.ComputeInt64Size(Quotient);
}
if (Remainder != 0L) {
size += 1 + pb::CodedOutputStream.ComputeInt64Size(Remainder);
}
if (_unknownFields != null) {
size += _unknownFields.CalculateSize();
}
return size;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(DivReply other) {
if (other == null) {
return;
}
if (other.Quotient != 0L) {
Quotient = other.Quotient;
}
if (other.Remainder != 0L) {
Remainder = other.Remainder;
}
_unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
_unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
break;
case 8: {
Quotient = input.ReadInt64();
break;
}
case 16: {
Remainder = input.ReadInt64();
break;
}
}
}
}
}
public sealed partial class FibArgs : pb::IMessage<FibArgs> {
private static readonly pb::MessageParser<FibArgs> _parser = new pb::MessageParser<FibArgs>(() => new FibArgs());
private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<FibArgs> Parser { get { return _parser; } }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pbr::MessageDescriptor Descriptor {
get { return global::MathWithProtocOptions.MathWithProtocOptionsReflection.Descriptor.MessageTypes[2]; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
pbr::MessageDescriptor pb::IMessage.Descriptor {
get { return Descriptor; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public FibArgs() {
OnConstruction();
}
partial void OnConstruction();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public FibArgs(FibArgs other) : this() {
limit_ = other.limit_;
_unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public FibArgs Clone() {
return new FibArgs(this);
}
/// <summary>Field number for the "limit" field.</summary>
public const int LimitFieldNumber = 1;
private long limit_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public long Limit {
get { return limit_; }
set {
limit_ = value;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override bool Equals(object other) {
return Equals(other as FibArgs);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool Equals(FibArgs other) {
if (ReferenceEquals(other, null)) {
return false;
}
if (ReferenceEquals(other, this)) {
return true;
}
if (Limit != other.Limit) return false;
return Equals(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
if (Limit != 0L) hash ^= Limit.GetHashCode();
if (_unknownFields != null) {
hash ^= _unknownFields.GetHashCode();
}
return hash;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override string ToString() {
return pb::JsonFormatter.ToDiagnosticString(this);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) {
if (Limit != 0L) {
output.WriteRawTag(8);
output.WriteInt64(Limit);
}
if (_unknownFields != null) {
_unknownFields.WriteTo(output);
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() {
int size = 0;
if (Limit != 0L) {
size += 1 + pb::CodedOutputStream.ComputeInt64Size(Limit);
}
if (_unknownFields != null) {
size += _unknownFields.CalculateSize();
}
return size;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(FibArgs other) {
if (other == null) {
return;
}
if (other.Limit != 0L) {
Limit = other.Limit;
}
_unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
_unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
break;
case 8: {
Limit = input.ReadInt64();
break;
}
}
}
}
}
public sealed partial class Num : pb::IMessage<Num> {
private static readonly pb::MessageParser<Num> _parser = new pb::MessageParser<Num>(() => new Num());
private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<Num> Parser { get { return _parser; } }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pbr::MessageDescriptor Descriptor {
get { return global::MathWithProtocOptions.MathWithProtocOptionsReflection.Descriptor.MessageTypes[3]; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
pbr::MessageDescriptor pb::IMessage.Descriptor {
get { return Descriptor; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public Num() {
OnConstruction();
}
partial void OnConstruction();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public Num(Num other) : this() {
num_ = other.num_;
_unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public Num Clone() {
return new Num(this);
}
/// <summary>Field number for the "num" field.</summary>
public const int Num_FieldNumber = 1;
private long num_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public long Num_ {
get { return num_; }
set {
num_ = value;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override bool Equals(object other) {
return Equals(other as Num);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool Equals(Num other) {
if (ReferenceEquals(other, null)) {
return false;
}
if (ReferenceEquals(other, this)) {
return true;
}
if (Num_ != other.Num_) return false;
return Equals(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
if (Num_ != 0L) hash ^= Num_.GetHashCode();
if (_unknownFields != null) {
hash ^= _unknownFields.GetHashCode();
}
return hash;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override string ToString() {
return pb::JsonFormatter.ToDiagnosticString(this);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) {
if (Num_ != 0L) {
output.WriteRawTag(8);
output.WriteInt64(Num_);
}
if (_unknownFields != null) {
_unknownFields.WriteTo(output);
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() {
int size = 0;
if (Num_ != 0L) {
size += 1 + pb::CodedOutputStream.ComputeInt64Size(Num_);
}
if (_unknownFields != null) {
size += _unknownFields.CalculateSize();
}
return size;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(Num other) {
if (other == null) {
return;
}
if (other.Num_ != 0L) {
Num_ = other.Num_;
}
_unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
_unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
break;
case 8: {
Num_ = input.ReadInt64();
break;
}
}
}
}
}
public sealed partial class FibReply : pb::IMessage<FibReply> {
private static readonly pb::MessageParser<FibReply> _parser = new pb::MessageParser<FibReply>(() => new FibReply());
private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<FibReply> Parser { get { return _parser; } }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pbr::MessageDescriptor Descriptor {
get { return global::MathWithProtocOptions.MathWithProtocOptionsReflection.Descriptor.MessageTypes[4]; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
pbr::MessageDescriptor pb::IMessage.Descriptor {
get { return Descriptor; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public FibReply() {
OnConstruction();
}
partial void OnConstruction();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public FibReply(FibReply other) : this() {
count_ = other.count_;
_unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public FibReply Clone() {
return new FibReply(this);
}
/// <summary>Field number for the "count" field.</summary>
public const int CountFieldNumber = 1;
private long count_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public long Count {
get { return count_; }
set {
count_ = value;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override bool Equals(object other) {
return Equals(other as FibReply);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool Equals(FibReply other) {
if (ReferenceEquals(other, null)) {
return false;
}
if (ReferenceEquals(other, this)) {
return true;
}
if (Count != other.Count) return false;
return Equals(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
if (Count != 0L) hash ^= Count.GetHashCode();
if (_unknownFields != null) {
hash ^= _unknownFields.GetHashCode();
}
return hash;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override string ToString() {
return pb::JsonFormatter.ToDiagnosticString(this);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) {
if (Count != 0L) {
output.WriteRawTag(8);
output.WriteInt64(Count);
}
if (_unknownFields != null) {
_unknownFields.WriteTo(output);
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() {
int size = 0;
if (Count != 0L) {
size += 1 + pb::CodedOutputStream.ComputeInt64Size(Count);
}
if (_unknownFields != null) {
size += _unknownFields.CalculateSize();
}
return size;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(FibReply other) {
if (other == null) {
return;
}
if (other.Count != 0L) {
Count = other.Count;
}
_unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
_unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
break;
case 8: {
Count = input.ReadInt64();
break;
}
}
}
}
}
#endregion
}
#endregion Designer generated code

@ -1,208 +0,0 @@
// <auto-generated>
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: math_with_protoc_options.proto
// </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.
// See the License for the specific language governing permissions and
// limitations under the License.
//
#pragma warning disable 0414, 1591
#region Designer generated code
using grpc = global::Grpc.Core;
namespace MathWithProtocOptions {
public static partial class Math
{
static readonly string __ServiceName = "math_with_protoc_options.Math";
static readonly grpc::Marshaller<global::MathWithProtocOptions.DivArgs> __Marshaller_math_with_protoc_options_DivArgs = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::MathWithProtocOptions.DivArgs.Parser.ParseFrom);
static readonly grpc::Marshaller<global::MathWithProtocOptions.DivReply> __Marshaller_math_with_protoc_options_DivReply = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::MathWithProtocOptions.DivReply.Parser.ParseFrom);
static readonly grpc::Marshaller<global::MathWithProtocOptions.FibArgs> __Marshaller_math_with_protoc_options_FibArgs = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::MathWithProtocOptions.FibArgs.Parser.ParseFrom);
static readonly grpc::Marshaller<global::MathWithProtocOptions.Num> __Marshaller_math_with_protoc_options_Num = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::MathWithProtocOptions.Num.Parser.ParseFrom);
static readonly grpc::Method<global::MathWithProtocOptions.DivArgs, global::MathWithProtocOptions.DivReply> __Method_Div = new grpc::Method<global::MathWithProtocOptions.DivArgs, global::MathWithProtocOptions.DivReply>(
grpc::MethodType.Unary,
__ServiceName,
"Div",
__Marshaller_math_with_protoc_options_DivArgs,
__Marshaller_math_with_protoc_options_DivReply);
static readonly grpc::Method<global::MathWithProtocOptions.DivArgs, global::MathWithProtocOptions.DivReply> __Method_DivMany = new grpc::Method<global::MathWithProtocOptions.DivArgs, global::MathWithProtocOptions.DivReply>(
grpc::MethodType.DuplexStreaming,
__ServiceName,
"DivMany",
__Marshaller_math_with_protoc_options_DivArgs,
__Marshaller_math_with_protoc_options_DivReply);
static readonly grpc::Method<global::MathWithProtocOptions.FibArgs, global::MathWithProtocOptions.Num> __Method_Fib = new grpc::Method<global::MathWithProtocOptions.FibArgs, global::MathWithProtocOptions.Num>(
grpc::MethodType.ServerStreaming,
__ServiceName,
"Fib",
__Marshaller_math_with_protoc_options_FibArgs,
__Marshaller_math_with_protoc_options_Num);
static readonly grpc::Method<global::MathWithProtocOptions.Num, global::MathWithProtocOptions.Num> __Method_Sum = new grpc::Method<global::MathWithProtocOptions.Num, global::MathWithProtocOptions.Num>(
grpc::MethodType.ClientStreaming,
__ServiceName,
"Sum",
__Marshaller_math_with_protoc_options_Num,
__Marshaller_math_with_protoc_options_Num);
/// <summary>Service descriptor</summary>
public static global::Google.Protobuf.Reflection.ServiceDescriptor Descriptor
{
get { return global::MathWithProtocOptions.MathWithProtocOptionsReflection.Descriptor.Services[0]; }
}
/// <summary>Lite client for Math</summary>
public partial class MathClient : grpc::LiteClientBase
{
/// <summary>Creates a new client for Math that uses a custom <c>CallInvoker</c>.</summary>
/// <param name="callInvoker">The callInvoker to use to make remote calls.</param>
public MathClient(grpc::CallInvoker callInvoker) : base(callInvoker)
{
}
/// <summary>Protected parameterless constructor to allow creation of test doubles.</summary>
protected MathClient() : base()
{
}
/// <summary>
/// Div divides DivArgs.dividend by DivArgs.divisor and returns the quotient
/// and remainder.
/// </summary>
/// <param name="request">The request to send to the server.</param>
/// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param>
/// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param>
/// <param name="cancellationToken">An optional token for canceling the call.</param>
/// <returns>The response received from the server.</returns>
public virtual global::MathWithProtocOptions.DivReply Div(global::MathWithProtocOptions.DivArgs request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken))
{
return Div(request, new grpc::CallOptions(headers, deadline, cancellationToken));
}
/// <summary>
/// Div divides DivArgs.dividend by DivArgs.divisor and returns the quotient
/// and remainder.
/// </summary>
/// <param name="request">The request to send to the server.</param>
/// <param name="options">The options for the call.</param>
/// <returns>The response received from the server.</returns>
public virtual global::MathWithProtocOptions.DivReply Div(global::MathWithProtocOptions.DivArgs request, grpc::CallOptions options)
{
return CallInvoker.BlockingUnaryCall(__Method_Div, null, options, request);
}
/// <summary>
/// Div divides DivArgs.dividend by DivArgs.divisor and returns the quotient
/// and remainder.
/// </summary>
/// <param name="request">The request to send to the server.</param>
/// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param>
/// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param>
/// <param name="cancellationToken">An optional token for canceling the call.</param>
/// <returns>The call object.</returns>
public virtual grpc::AsyncUnaryCall<global::MathWithProtocOptions.DivReply> DivAsync(global::MathWithProtocOptions.DivArgs request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken))
{
return DivAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken));
}
/// <summary>
/// Div divides DivArgs.dividend by DivArgs.divisor and returns the quotient
/// and remainder.
/// </summary>
/// <param name="request">The request to send to the server.</param>
/// <param name="options">The options for the call.</param>
/// <returns>The call object.</returns>
public virtual grpc::AsyncUnaryCall<global::MathWithProtocOptions.DivReply> DivAsync(global::MathWithProtocOptions.DivArgs request, grpc::CallOptions options)
{
return CallInvoker.AsyncUnaryCall(__Method_Div, null, options, request);
}
/// <summary>
/// DivMany accepts an arbitrary number of division args from the client stream
/// and sends back the results in the reply stream. The stream continues until
/// the client closes its end; the server does the same after sending all the
/// replies. The stream ends immediately if either end aborts.
/// </summary>
/// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param>
/// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param>
/// <param name="cancellationToken">An optional token for canceling the call.</param>
/// <returns>The call object.</returns>
public virtual grpc::AsyncDuplexStreamingCall<global::MathWithProtocOptions.DivArgs, global::MathWithProtocOptions.DivReply> DivMany(grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken))
{
return DivMany(new grpc::CallOptions(headers, deadline, cancellationToken));
}
/// <summary>
/// DivMany accepts an arbitrary number of division args from the client stream
/// and sends back the results in the reply stream. The stream continues until
/// the client closes its end; the server does the same after sending all the
/// replies. The stream ends immediately if either end aborts.
/// </summary>
/// <param name="options">The options for the call.</param>
/// <returns>The call object.</returns>
public virtual grpc::AsyncDuplexStreamingCall<global::MathWithProtocOptions.DivArgs, global::MathWithProtocOptions.DivReply> DivMany(grpc::CallOptions options)
{
return CallInvoker.AsyncDuplexStreamingCall(__Method_DivMany, null, options);
}
/// <summary>
/// Fib generates numbers in the Fibonacci sequence. If FibArgs.limit > 0, Fib
/// generates up to limit numbers; otherwise it continues until the call is
/// canceled. Unlike Fib above, Fib has no final FibReply.
/// </summary>
/// <param name="request">The request to send to the server.</param>
/// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param>
/// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param>
/// <param name="cancellationToken">An optional token for canceling the call.</param>
/// <returns>The call object.</returns>
public virtual grpc::AsyncServerStreamingCall<global::MathWithProtocOptions.Num> Fib(global::MathWithProtocOptions.FibArgs request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken))
{
return Fib(request, new grpc::CallOptions(headers, deadline, cancellationToken));
}
/// <summary>
/// Fib generates numbers in the Fibonacci sequence. If FibArgs.limit > 0, Fib
/// generates up to limit numbers; otherwise it continues until the call is
/// canceled. Unlike Fib above, Fib has no final FibReply.
/// </summary>
/// <param name="request">The request to send to the server.</param>
/// <param name="options">The options for the call.</param>
/// <returns>The call object.</returns>
public virtual grpc::AsyncServerStreamingCall<global::MathWithProtocOptions.Num> Fib(global::MathWithProtocOptions.FibArgs request, grpc::CallOptions options)
{
return CallInvoker.AsyncServerStreamingCall(__Method_Fib, null, options, request);
}
/// <summary>
/// Sum sums a stream of numbers, returning the final result once the stream
/// is closed.
/// </summary>
/// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param>
/// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param>
/// <param name="cancellationToken">An optional token for canceling the call.</param>
/// <returns>The call object.</returns>
public virtual grpc::AsyncClientStreamingCall<global::MathWithProtocOptions.Num, global::MathWithProtocOptions.Num> Sum(grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken))
{
return Sum(new grpc::CallOptions(headers, deadline, cancellationToken));
}
/// <summary>
/// Sum sums a stream of numbers, returning the final result once the stream
/// is closed.
/// </summary>
/// <param name="options">The options for the call.</param>
/// <returns>The call object.</returns>
public virtual grpc::AsyncClientStreamingCall<global::MathWithProtocOptions.Num, global::MathWithProtocOptions.Num> Sum(grpc::CallOptions options)
{
return CallInvoker.AsyncClientStreamingCall(__Method_Sum, null, options);
}
}
}
}
#endregion

@ -1,65 +0,0 @@
// 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.
// See the License for the specific language governing permissions and
// limitations under the License.
syntax = "proto3";
package math_with_protoc_options;
message DivArgs {
int64 dividend = 1;
int64 divisor = 2;
}
message DivReply {
int64 quotient = 1;
int64 remainder = 2;
}
message FibArgs {
int64 limit = 1;
}
message Num {
int64 num = 1;
}
message FibReply {
int64 count = 1;
}
service Math {
// Div divides DivArgs.dividend by DivArgs.divisor and returns the quotient
// and remainder.
rpc Div (DivArgs) returns (DivReply) {
}
// DivMany accepts an arbitrary number of division args from the client stream
// and sends back the results in the reply stream. The stream continues until
// the client closes its end; the server does the same after sending all the
// replies. The stream ends immediately if either end aborts.
rpc DivMany (stream DivArgs) returns (stream DivReply) {
}
// Fib generates numbers in the Fibonacci sequence. If FibArgs.limit > 0, Fib
// generates up to limit numbers; otherwise it continues until the call is
// canceled. Unlike Fib above, Fib has no final FibReply.
rpc Fib (FibArgs) returns (stream Num) {
}
// Sum sums a stream of numbers, returning the final result once the stream
// is closed.
rpc Sum (stream Num) returns (Num) {
}
}

@ -476,8 +476,7 @@ namespace Grpc.IntegrationTesting
} }
catch (RpcException ex) catch (RpcException ex)
{ {
// We can't guarantee the status code always DeadlineExceeded. See issue #2685. Assert.AreEqual(StatusCode.DeadlineExceeded, ex.Status.StatusCode);
Assert.Contains(ex.Status.StatusCode, new[] { StatusCode.DeadlineExceeded, StatusCode.Internal });
} }
} }
Console.WriteLine("Passed!"); Console.WriteLine("Passed!");

@ -28,7 +28,7 @@ namespace Grpc.Testing {
"LnRlc3RpbmciGgoJQm9vbFZhbHVlEg0KBXZhbHVlGAEgASgIIkAKB1BheWxv", "LnRlc3RpbmciGgoJQm9vbFZhbHVlEg0KBXZhbHVlGAEgASgIIkAKB1BheWxv",
"YWQSJwoEdHlwZRgBIAEoDjIZLmdycGMudGVzdGluZy5QYXlsb2FkVHlwZRIM", "YWQSJwoEdHlwZRgBIAEoDjIZLmdycGMudGVzdGluZy5QYXlsb2FkVHlwZRIM",
"CgRib2R5GAIgASgMIisKCkVjaG9TdGF0dXMSDAoEY29kZRgBIAEoBRIPCgdt", "CgRib2R5GAIgASgMIisKCkVjaG9TdGF0dXMSDAoEY29kZRgBIAEoBRIPCgdt",
"ZXNzYWdlGAIgASgJIuYCCg1TaW1wbGVSZXF1ZXN0EjAKDXJlc3BvbnNlX3R5", "ZXNzYWdlGAIgASgJIoYDCg1TaW1wbGVSZXF1ZXN0EjAKDXJlc3BvbnNlX3R5",
"cGUYASABKA4yGS5ncnBjLnRlc3RpbmcuUGF5bG9hZFR5cGUSFQoNcmVzcG9u", "cGUYASABKA4yGS5ncnBjLnRlc3RpbmcuUGF5bG9hZFR5cGUSFQoNcmVzcG9u",
"c2Vfc2l6ZRgCIAEoBRImCgdwYXlsb2FkGAMgASgLMhUuZ3JwYy50ZXN0aW5n", "c2Vfc2l6ZRgCIAEoBRImCgdwYXlsb2FkGAMgASgLMhUuZ3JwYy50ZXN0aW5n",
"LlBheWxvYWQSFQoNZmlsbF91c2VybmFtZRgEIAEoCBIYChBmaWxsX29hdXRo", "LlBheWxvYWQSFQoNZmlsbF91c2VybmFtZRgEIAEoCBIYChBmaWxsX29hdXRo",
@ -36,34 +36,38 @@ namespace Grpc.Testing {
"cnBjLnRlc3RpbmcuQm9vbFZhbHVlEjEKD3Jlc3BvbnNlX3N0YXR1cxgHIAEo", "cnBjLnRlc3RpbmcuQm9vbFZhbHVlEjEKD3Jlc3BvbnNlX3N0YXR1cxgHIAEo",
"CzIYLmdycGMudGVzdGluZy5FY2hvU3RhdHVzEjIKEWV4cGVjdF9jb21wcmVz", "CzIYLmdycGMudGVzdGluZy5FY2hvU3RhdHVzEjIKEWV4cGVjdF9jb21wcmVz",
"c2VkGAggASgLMhcuZ3JwYy50ZXN0aW5nLkJvb2xWYWx1ZRIWCg5maWxsX3Nl", "c2VkGAggASgLMhcuZ3JwYy50ZXN0aW5nLkJvb2xWYWx1ZRIWCg5maWxsX3Nl",
"cnZlcl9pZBgJIAEoCCJyCg5TaW1wbGVSZXNwb25zZRImCgdwYXlsb2FkGAEg", "cnZlcl9pZBgJIAEoCBIeChZmaWxsX2dycGNsYl9yb3V0ZV90eXBlGAogASgI",
"ASgLMhUuZ3JwYy50ZXN0aW5nLlBheWxvYWQSEAoIdXNlcm5hbWUYAiABKAkS", "IqwBCg5TaW1wbGVSZXNwb25zZRImCgdwYXlsb2FkGAEgASgLMhUuZ3JwYy50",
"EwoLb2F1dGhfc2NvcGUYAyABKAkSEQoJc2VydmVyX2lkGAQgASgJIncKGVN0", "ZXN0aW5nLlBheWxvYWQSEAoIdXNlcm5hbWUYAiABKAkSEwoLb2F1dGhfc2Nv",
"cmVhbWluZ0lucHV0Q2FsbFJlcXVlc3QSJgoHcGF5bG9hZBgBIAEoCzIVLmdy", "cGUYAyABKAkSEQoJc2VydmVyX2lkGAQgASgJEjgKEWdycGNsYl9yb3V0ZV90",
"cGMudGVzdGluZy5QYXlsb2FkEjIKEWV4cGVjdF9jb21wcmVzc2VkGAIgASgL", "eXBlGAUgASgOMh0uZ3JwYy50ZXN0aW5nLkdycGNsYlJvdXRlVHlwZSJ3ChlT",
"MhcuZ3JwYy50ZXN0aW5nLkJvb2xWYWx1ZSI9ChpTdHJlYW1pbmdJbnB1dENh", "dHJlYW1pbmdJbnB1dENhbGxSZXF1ZXN0EiYKB3BheWxvYWQYASABKAsyFS5n",
"bGxSZXNwb25zZRIfChdhZ2dyZWdhdGVkX3BheWxvYWRfc2l6ZRgBIAEoBSJk", "cnBjLnRlc3RpbmcuUGF5bG9hZBIyChFleHBlY3RfY29tcHJlc3NlZBgCIAEo",
"ChJSZXNwb25zZVBhcmFtZXRlcnMSDAoEc2l6ZRgBIAEoBRITCgtpbnRlcnZh", "CzIXLmdycGMudGVzdGluZy5Cb29sVmFsdWUiPQoaU3RyZWFtaW5nSW5wdXRD",
"bF91cxgCIAEoBRIrCgpjb21wcmVzc2VkGAMgASgLMhcuZ3JwYy50ZXN0aW5n", "YWxsUmVzcG9uc2USHwoXYWdncmVnYXRlZF9wYXlsb2FkX3NpemUYASABKAUi",
"LkJvb2xWYWx1ZSLoAQoaU3RyZWFtaW5nT3V0cHV0Q2FsbFJlcXVlc3QSMAoN", "ZAoSUmVzcG9uc2VQYXJhbWV0ZXJzEgwKBHNpemUYASABKAUSEwoLaW50ZXJ2",
"cmVzcG9uc2VfdHlwZRgBIAEoDjIZLmdycGMudGVzdGluZy5QYXlsb2FkVHlw", "YWxfdXMYAiABKAUSKwoKY29tcHJlc3NlZBgDIAEoCzIXLmdycGMudGVzdGlu",
"ZRI9ChNyZXNwb25zZV9wYXJhbWV0ZXJzGAIgAygLMiAuZ3JwYy50ZXN0aW5n", "Zy5Cb29sVmFsdWUi6AEKGlN0cmVhbWluZ091dHB1dENhbGxSZXF1ZXN0EjAK",
"LlJlc3BvbnNlUGFyYW1ldGVycxImCgdwYXlsb2FkGAMgASgLMhUuZ3JwYy50", "DXJlc3BvbnNlX3R5cGUYASABKA4yGS5ncnBjLnRlc3RpbmcuUGF5bG9hZFR5",
"ZXN0aW5nLlBheWxvYWQSMQoPcmVzcG9uc2Vfc3RhdHVzGAcgASgLMhguZ3Jw", "cGUSPQoTcmVzcG9uc2VfcGFyYW1ldGVycxgCIAMoCzIgLmdycGMudGVzdGlu",
"Yy50ZXN0aW5nLkVjaG9TdGF0dXMiRQobU3RyZWFtaW5nT3V0cHV0Q2FsbFJl", "Zy5SZXNwb25zZVBhcmFtZXRlcnMSJgoHcGF5bG9hZBgDIAEoCzIVLmdycGMu",
"c3BvbnNlEiYKB3BheWxvYWQYASABKAsyFS5ncnBjLnRlc3RpbmcuUGF5bG9h", "dGVzdGluZy5QYXlsb2FkEjEKD3Jlc3BvbnNlX3N0YXR1cxgHIAEoCzIYLmdy",
"ZCIzCg9SZWNvbm5lY3RQYXJhbXMSIAoYbWF4X3JlY29ubmVjdF9iYWNrb2Zm", "cGMudGVzdGluZy5FY2hvU3RhdHVzIkUKG1N0cmVhbWluZ091dHB1dENhbGxS",
"X21zGAEgASgFIjMKDVJlY29ubmVjdEluZm8SDgoGcGFzc2VkGAEgASgIEhIK", "ZXNwb25zZRImCgdwYXlsb2FkGAEgASgLMhUuZ3JwYy50ZXN0aW5nLlBheWxv",
"CmJhY2tvZmZfbXMYAiADKAUqHwoLUGF5bG9hZFR5cGUSEAoMQ09NUFJFU1NB", "YWQiMwoPUmVjb25uZWN0UGFyYW1zEiAKGG1heF9yZWNvbm5lY3RfYmFja29m",
"QkxFEABiBnByb3RvMw==")); "Zl9tcxgBIAEoBSIzCg1SZWNvbm5lY3RJbmZvEg4KBnBhc3NlZBgBIAEoCBIS",
"CgpiYWNrb2ZmX21zGAIgAygFKh8KC1BheWxvYWRUeXBlEhAKDENPTVBSRVNT",
"QUJMRRAAKm8KD0dycGNsYlJvdXRlVHlwZRIdChlHUlBDTEJfUk9VVEVfVFlQ",
"RV9VTktOT1dOEAASHgoaR1JQQ0xCX1JPVVRFX1RZUEVfRkFMTEJBQ0sQARId",
"ChlHUlBDTEJfUk9VVEVfVFlQRV9CQUNLRU5EEAJiBnByb3RvMw=="));
descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
new pbr::FileDescriptor[] { }, new pbr::FileDescriptor[] { },
new pbr::GeneratedClrTypeInfo(new[] {typeof(global::Grpc.Testing.PayloadType), }, new pbr::GeneratedClrTypeInfo[] { new pbr::GeneratedClrTypeInfo(new[] {typeof(global::Grpc.Testing.PayloadType), typeof(global::Grpc.Testing.GrpclbRouteType), }, new pbr::GeneratedClrTypeInfo[] {
new pbr::GeneratedClrTypeInfo(typeof(global::Grpc.Testing.BoolValue), global::Grpc.Testing.BoolValue.Parser, new[]{ "Value" }, null, null, null), new pbr::GeneratedClrTypeInfo(typeof(global::Grpc.Testing.BoolValue), global::Grpc.Testing.BoolValue.Parser, new[]{ "Value" }, null, null, null),
new pbr::GeneratedClrTypeInfo(typeof(global::Grpc.Testing.Payload), global::Grpc.Testing.Payload.Parser, new[]{ "Type", "Body" }, null, null, null), new pbr::GeneratedClrTypeInfo(typeof(global::Grpc.Testing.Payload), global::Grpc.Testing.Payload.Parser, new[]{ "Type", "Body" }, null, null, null),
new pbr::GeneratedClrTypeInfo(typeof(global::Grpc.Testing.EchoStatus), global::Grpc.Testing.EchoStatus.Parser, new[]{ "Code", "Message" }, null, null, null), new pbr::GeneratedClrTypeInfo(typeof(global::Grpc.Testing.EchoStatus), global::Grpc.Testing.EchoStatus.Parser, new[]{ "Code", "Message" }, null, null, null),
new pbr::GeneratedClrTypeInfo(typeof(global::Grpc.Testing.SimpleRequest), global::Grpc.Testing.SimpleRequest.Parser, new[]{ "ResponseType", "ResponseSize", "Payload", "FillUsername", "FillOauthScope", "ResponseCompressed", "ResponseStatus", "ExpectCompressed", "FillServerId" }, null, null, null), new pbr::GeneratedClrTypeInfo(typeof(global::Grpc.Testing.SimpleRequest), global::Grpc.Testing.SimpleRequest.Parser, new[]{ "ResponseType", "ResponseSize", "Payload", "FillUsername", "FillOauthScope", "ResponseCompressed", "ResponseStatus", "ExpectCompressed", "FillServerId", "FillGrpclbRouteType" }, null, null, null),
new pbr::GeneratedClrTypeInfo(typeof(global::Grpc.Testing.SimpleResponse), global::Grpc.Testing.SimpleResponse.Parser, new[]{ "Payload", "Username", "OauthScope", "ServerId" }, null, null, null), new pbr::GeneratedClrTypeInfo(typeof(global::Grpc.Testing.SimpleResponse), global::Grpc.Testing.SimpleResponse.Parser, new[]{ "Payload", "Username", "OauthScope", "ServerId", "GrpclbRouteType" }, null, null, null),
new pbr::GeneratedClrTypeInfo(typeof(global::Grpc.Testing.StreamingInputCallRequest), global::Grpc.Testing.StreamingInputCallRequest.Parser, new[]{ "Payload", "ExpectCompressed" }, null, null, null), new pbr::GeneratedClrTypeInfo(typeof(global::Grpc.Testing.StreamingInputCallRequest), global::Grpc.Testing.StreamingInputCallRequest.Parser, new[]{ "Payload", "ExpectCompressed" }, null, null, null),
new pbr::GeneratedClrTypeInfo(typeof(global::Grpc.Testing.StreamingInputCallResponse), global::Grpc.Testing.StreamingInputCallResponse.Parser, new[]{ "AggregatedPayloadSize" }, null, null, null), new pbr::GeneratedClrTypeInfo(typeof(global::Grpc.Testing.StreamingInputCallResponse), global::Grpc.Testing.StreamingInputCallResponse.Parser, new[]{ "AggregatedPayloadSize" }, null, null, null),
new pbr::GeneratedClrTypeInfo(typeof(global::Grpc.Testing.ResponseParameters), global::Grpc.Testing.ResponseParameters.Parser, new[]{ "Size", "IntervalUs", "Compressed" }, null, null, null), new pbr::GeneratedClrTypeInfo(typeof(global::Grpc.Testing.ResponseParameters), global::Grpc.Testing.ResponseParameters.Parser, new[]{ "Size", "IntervalUs", "Compressed" }, null, null, null),
@ -87,6 +91,29 @@ namespace Grpc.Testing {
[pbr::OriginalName("COMPRESSABLE")] Compressable = 0, [pbr::OriginalName("COMPRESSABLE")] Compressable = 0,
} }
/// <summary>
/// The type of route that a client took to reach a server w.r.t. gRPCLB.
/// The server must fill in "fallback" if it detects that the RPC reached
/// the server via the "gRPCLB fallback" path, and "backend" if it detects
/// that the RPC reached the server via "gRPCLB backend" path (i.e. if it got
/// the address of this server from the gRPCLB server BalanceLoad RPC). Exactly
/// how this detection is done is context and server dependant.
/// </summary>
public enum GrpclbRouteType {
/// <summary>
/// Server didn't detect the route that a client took to reach it.
/// </summary>
[pbr::OriginalName("GRPCLB_ROUTE_TYPE_UNKNOWN")] Unknown = 0,
/// <summary>
/// Indicates that a client reached a server via gRPCLB fallback.
/// </summary>
[pbr::OriginalName("GRPCLB_ROUTE_TYPE_FALLBACK")] Fallback = 1,
/// <summary>
/// Indicates that a client reached a server as a gRPCLB-given backend.
/// </summary>
[pbr::OriginalName("GRPCLB_ROUTE_TYPE_BACKEND")] Backend = 2,
}
#endregion #endregion
#region Messages #region Messages
@ -591,6 +618,7 @@ namespace Grpc.Testing {
responseStatus_ = other.responseStatus_ != null ? other.responseStatus_.Clone() : null; responseStatus_ = other.responseStatus_ != null ? other.responseStatus_.Clone() : null;
expectCompressed_ = other.expectCompressed_ != null ? other.expectCompressed_.Clone() : null; expectCompressed_ = other.expectCompressed_ != null ? other.expectCompressed_.Clone() : null;
fillServerId_ = other.fillServerId_; fillServerId_ = other.fillServerId_;
fillGrpclbRouteType_ = other.fillGrpclbRouteType_;
_unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
} }
@ -729,6 +757,20 @@ namespace Grpc.Testing {
} }
} }
/// <summary>Field number for the "fill_grpclb_route_type" field.</summary>
public const int FillGrpclbRouteTypeFieldNumber = 10;
private bool fillGrpclbRouteType_;
/// <summary>
/// Whether SimpleResponse should include grpclb_route_type.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool FillGrpclbRouteType {
get { return fillGrpclbRouteType_; }
set {
fillGrpclbRouteType_ = value;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override bool Equals(object other) { public override bool Equals(object other) {
return Equals(other as SimpleRequest); return Equals(other as SimpleRequest);
@ -751,6 +793,7 @@ namespace Grpc.Testing {
if (!object.Equals(ResponseStatus, other.ResponseStatus)) return false; if (!object.Equals(ResponseStatus, other.ResponseStatus)) return false;
if (!object.Equals(ExpectCompressed, other.ExpectCompressed)) return false; if (!object.Equals(ExpectCompressed, other.ExpectCompressed)) return false;
if (FillServerId != other.FillServerId) return false; if (FillServerId != other.FillServerId) return false;
if (FillGrpclbRouteType != other.FillGrpclbRouteType) return false;
return Equals(_unknownFields, other._unknownFields); return Equals(_unknownFields, other._unknownFields);
} }
@ -766,6 +809,7 @@ namespace Grpc.Testing {
if (responseStatus_ != null) hash ^= ResponseStatus.GetHashCode(); if (responseStatus_ != null) hash ^= ResponseStatus.GetHashCode();
if (expectCompressed_ != null) hash ^= ExpectCompressed.GetHashCode(); if (expectCompressed_ != null) hash ^= ExpectCompressed.GetHashCode();
if (FillServerId != false) hash ^= FillServerId.GetHashCode(); if (FillServerId != false) hash ^= FillServerId.GetHashCode();
if (FillGrpclbRouteType != false) hash ^= FillGrpclbRouteType.GetHashCode();
if (_unknownFields != null) { if (_unknownFields != null) {
hash ^= _unknownFields.GetHashCode(); hash ^= _unknownFields.GetHashCode();
} }
@ -815,6 +859,10 @@ namespace Grpc.Testing {
output.WriteRawTag(72); output.WriteRawTag(72);
output.WriteBool(FillServerId); output.WriteBool(FillServerId);
} }
if (FillGrpclbRouteType != false) {
output.WriteRawTag(80);
output.WriteBool(FillGrpclbRouteType);
}
if (_unknownFields != null) { if (_unknownFields != null) {
_unknownFields.WriteTo(output); _unknownFields.WriteTo(output);
} }
@ -850,6 +898,9 @@ namespace Grpc.Testing {
if (FillServerId != false) { if (FillServerId != false) {
size += 1 + 1; size += 1 + 1;
} }
if (FillGrpclbRouteType != false) {
size += 1 + 1;
}
if (_unknownFields != null) { if (_unknownFields != null) {
size += _unknownFields.CalculateSize(); size += _unknownFields.CalculateSize();
} }
@ -900,6 +951,9 @@ namespace Grpc.Testing {
if (other.FillServerId != false) { if (other.FillServerId != false) {
FillServerId = other.FillServerId; FillServerId = other.FillServerId;
} }
if (other.FillGrpclbRouteType != false) {
FillGrpclbRouteType = other.FillGrpclbRouteType;
}
_unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
} }
@ -959,6 +1013,10 @@ namespace Grpc.Testing {
FillServerId = input.ReadBool(); FillServerId = input.ReadBool();
break; break;
} }
case 80: {
FillGrpclbRouteType = input.ReadBool();
break;
}
} }
} }
} }
@ -997,6 +1055,7 @@ namespace Grpc.Testing {
username_ = other.username_; username_ = other.username_;
oauthScope_ = other.oauthScope_; oauthScope_ = other.oauthScope_;
serverId_ = other.serverId_; serverId_ = other.serverId_;
grpclbRouteType_ = other.grpclbRouteType_;
_unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
} }
@ -1063,6 +1122,20 @@ namespace Grpc.Testing {
} }
} }
/// <summary>Field number for the "grpclb_route_type" field.</summary>
public const int GrpclbRouteTypeFieldNumber = 5;
private global::Grpc.Testing.GrpclbRouteType grpclbRouteType_ = 0;
/// <summary>
/// gRPCLB Path.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public global::Grpc.Testing.GrpclbRouteType GrpclbRouteType {
get { return grpclbRouteType_; }
set {
grpclbRouteType_ = value;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override bool Equals(object other) { public override bool Equals(object other) {
return Equals(other as SimpleResponse); return Equals(other as SimpleResponse);
@ -1080,6 +1153,7 @@ namespace Grpc.Testing {
if (Username != other.Username) return false; if (Username != other.Username) return false;
if (OauthScope != other.OauthScope) return false; if (OauthScope != other.OauthScope) return false;
if (ServerId != other.ServerId) return false; if (ServerId != other.ServerId) return false;
if (GrpclbRouteType != other.GrpclbRouteType) return false;
return Equals(_unknownFields, other._unknownFields); return Equals(_unknownFields, other._unknownFields);
} }
@ -1090,6 +1164,7 @@ namespace Grpc.Testing {
if (Username.Length != 0) hash ^= Username.GetHashCode(); if (Username.Length != 0) hash ^= Username.GetHashCode();
if (OauthScope.Length != 0) hash ^= OauthScope.GetHashCode(); if (OauthScope.Length != 0) hash ^= OauthScope.GetHashCode();
if (ServerId.Length != 0) hash ^= ServerId.GetHashCode(); if (ServerId.Length != 0) hash ^= ServerId.GetHashCode();
if (GrpclbRouteType != 0) hash ^= GrpclbRouteType.GetHashCode();
if (_unknownFields != null) { if (_unknownFields != null) {
hash ^= _unknownFields.GetHashCode(); hash ^= _unknownFields.GetHashCode();
} }
@ -1119,6 +1194,10 @@ namespace Grpc.Testing {
output.WriteRawTag(34); output.WriteRawTag(34);
output.WriteString(ServerId); output.WriteString(ServerId);
} }
if (GrpclbRouteType != 0) {
output.WriteRawTag(40);
output.WriteEnum((int) GrpclbRouteType);
}
if (_unknownFields != null) { if (_unknownFields != null) {
_unknownFields.WriteTo(output); _unknownFields.WriteTo(output);
} }
@ -1139,6 +1218,9 @@ namespace Grpc.Testing {
if (ServerId.Length != 0) { if (ServerId.Length != 0) {
size += 1 + pb::CodedOutputStream.ComputeStringSize(ServerId); size += 1 + pb::CodedOutputStream.ComputeStringSize(ServerId);
} }
if (GrpclbRouteType != 0) {
size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) GrpclbRouteType);
}
if (_unknownFields != null) { if (_unknownFields != null) {
size += _unknownFields.CalculateSize(); size += _unknownFields.CalculateSize();
} }
@ -1165,6 +1247,9 @@ namespace Grpc.Testing {
if (other.ServerId.Length != 0) { if (other.ServerId.Length != 0) {
ServerId = other.ServerId; ServerId = other.ServerId;
} }
if (other.GrpclbRouteType != 0) {
GrpclbRouteType = other.GrpclbRouteType;
}
_unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
} }
@ -1195,6 +1280,10 @@ namespace Grpc.Testing {
ServerId = input.ReadString(); ServerId = input.ReadString();
break; break;
} }
case 40: {
GrpclbRouteType = (global::Grpc.Testing.GrpclbRouteType) input.ReadEnum();
break;
}
} }
} }
} }

@ -86,7 +86,7 @@ namespace Grpc.Microbenchmarks
await server.ShutdownAsync(); await server.ShutdownAsync();
} }
class PingClient : LiteClientBase class PingClient : ClientBase
{ {
public PingClient(CallInvoker callInvoker) : base(callInvoker) { } public PingClient(CallInvoker callInvoker) : base(callInvoker) { }
public AsyncUnaryCall<string> PingAsync(string request, CallOptions options) public AsyncUnaryCall<string> PingAsync(string request, CallOptions options)

@ -91,7 +91,7 @@ namespace Grpc.Microbenchmarks
await channel.ShutdownAsync(); await channel.ShutdownAsync();
} }
class PingClient : LiteClientBase class PingClient : ClientBase
{ {
public PingClient(CallInvoker callInvoker) : base(callInvoker) { } public PingClient(CallInvoker callInvoker) : base(callInvoker) { }

@ -26,16 +26,5 @@
</EnumProperty.DataSource> </EnumProperty.DataSource>
</EnumProperty> </EnumProperty>
<EnumProperty Name="ClientBaseType" DisplayName="gRPC Client Base Type"
Category="gRPC" Default="ClientBase"
Description="The base type to use for the client. This is an experimental feature.">
<EnumValue Name="ClientBase" DisplayName="Use ClientBase" />
<EnumValue Name="LiteClientBase" DisplayName="Use LiteClientBase" />
<EnumProperty.DataSource>
<DataSource ItemType="Protobuf" SourceOfDefaultValue="AfterContext"
PersistenceStyle="Attribute" />
</EnumProperty.DataSource>
</EnumProperty>
</Rule> </Rule>
</ProjectSchemaDefinitions> </ProjectSchemaDefinitions>

@ -42,9 +42,6 @@
<Protobuf_Compile Condition=" '%(Protobuf_Compile.GrpcServices)' == 'Server' "> <Protobuf_Compile Condition=" '%(Protobuf_Compile.GrpcServices)' == 'Server' ">
<_GrpcOutputOptions>%(Protobuf_Compile._GrpcOutputOptions);no_client</_GrpcOutputOptions> <_GrpcOutputOptions>%(Protobuf_Compile._GrpcOutputOptions);no_client</_GrpcOutputOptions>
</Protobuf_Compile> </Protobuf_Compile>
<Protobuf_Compile Condition=" '%(Protobuf_Compile.GrpcServices)' == 'Client' or '%(Protobuf_Compile.GrpcServices)' == 'Both' ">
<_GrpcOutputOptions Condition=" '%(Protobuf_Compile.ClientBaseType)' == 'LiteClientBase' ">%(Protobuf_Compile._GrpcOutputOptions);lite_client</_GrpcOutputOptions>
</Protobuf_Compile>
</ItemGroup> </ItemGroup>
</Target> </Target>
</Project> </Project>

@ -28,7 +28,7 @@ function build {
PATH_CC="$(xcrun --sdk $SDK --find clang)" PATH_CC="$(xcrun --sdk $SDK --find clang)"
PATH_CXX="$(xcrun --sdk $SDK --find clang++)" PATH_CXX="$(xcrun --sdk $SDK --find clang++)"
CPPFLAGS="-O2 -Wframe-larger-than=16384 -arch $ARCH -isysroot $(xcrun --sdk $SDK --show-sdk-path) -mios-version-min=6.0 -DPB_NO_PACKED_STRUCTS=1" CPPFLAGS="-O2 -Wframe-larger-than=16384 -arch $ARCH -isysroot $(xcrun --sdk $SDK --show-sdk-path) -fembed-bitcode -mios-version-min=6.0 -DPB_NO_PACKED_STRUCTS=1"
LDFLAGS="-arch $ARCH -isysroot $(xcrun --sdk $SDK --show-sdk-path) -Wl,ios_version_min=6.0" LDFLAGS="-arch $ARCH -isysroot $(xcrun --sdk $SDK --show-sdk-path) -Wl,ios_version_min=6.0"
# TODO(jtattermusch): revisit the build arguments # TODO(jtattermusch): revisit the build arguments

@ -26,8 +26,6 @@ TESTING_DIR=src/csharp/Grpc.IntegrationTesting
$PROTOC --plugin=$PLUGIN --csharp_out=$EXAMPLES_DIR --grpc_out=$EXAMPLES_DIR \ $PROTOC --plugin=$PLUGIN --csharp_out=$EXAMPLES_DIR --grpc_out=$EXAMPLES_DIR \
-I src/proto src/proto/math/math.proto -I src/proto src/proto/math/math.proto
$PROTOC --plugin=$PLUGIN --csharp_out=$EXAMPLES_DIR --grpc_out=$EXAMPLES_DIR --grpc_opt=lite_client,no_server \
-I src/csharp/Grpc.Examples src/csharp/Grpc.Examples/math_with_protoc_options.proto
$PROTOC --plugin=$PLUGIN --csharp_out=$HEALTHCHECK_DIR --grpc_out=$HEALTHCHECK_DIR \ $PROTOC --plugin=$PLUGIN --csharp_out=$HEALTHCHECK_DIR --grpc_out=$HEALTHCHECK_DIR \
-I src/proto src/proto/grpc/health/v1/health.proto -I src/proto src/proto/grpc/health/v1/health.proto

@ -342,10 +342,6 @@ bool BuiltUnderUbsan() {
#endif #endif
} }
bool grpc_test_built_under_tsan_or_msan() {
return BuiltUnderTsan() || BuiltUnderMsan();
};
int64_t grpc_test_sanitizer_slowdown_factor() { int64_t grpc_test_sanitizer_slowdown_factor() {
int64_t sanitizer_multiplier = 1; int64_t sanitizer_multiplier = 1;
if (BuiltUnderValgrind()) { if (BuiltUnderValgrind()) {

@ -24,9 +24,6 @@
extern int64_t g_fixture_slowdown_factor; extern int64_t g_fixture_slowdown_factor;
extern int64_t g_poller_slowdown_factor; extern int64_t g_poller_slowdown_factor;
/* Returns if the test is built under TSAN or MSAN. */
bool grpc_test_built_under_tsan_or_msan();
/* Returns an appropriate scaling factor for timeouts. */ /* Returns an appropriate scaling factor for timeouts. */
int64_t grpc_test_slowdown_factor(); int64_t grpc_test_slowdown_factor();

@ -34,7 +34,6 @@
#include "src/core/ext/filters/client_channel/backup_poller.h" #include "src/core/ext/filters/client_channel/backup_poller.h"
#include "src/core/lib/gpr/tls.h" #include "src/core/lib/gpr/tls.h"
#include "src/core/lib/gpr/useful.h"
#include "src/core/lib/iomgr/port.h" #include "src/core/lib/iomgr/port.h"
#include "src/proto/grpc/health/v1/health.grpc.pb.h" #include "src/proto/grpc/health/v1/health.grpc.pb.h"
#include "src/proto/grpc/testing/duplicate/echo_duplicate.grpc.pb.h" #include "src/proto/grpc/testing/duplicate/echo_duplicate.grpc.pb.h"
@ -60,18 +59,6 @@ namespace testing {
namespace { namespace {
const size_t MAX_TEST_MESSAGE_SIZE =
#if defined(GPR_APPLE)
// The test will time out with macos build.
GRPC_DEFAULT_MAX_RECV_MESSAGE_LENGTH;
#else
// Don't test extreme size under tsan or msan, because it uses too much
// memory.
grpc_test_built_under_tsan_or_msan()
? GRPC_DEFAULT_MAX_RECV_MESSAGE_LENGTH
: GPR_MAX(100 * 1024 * 1024, GRPC_DEFAULT_MAX_RECV_MESSAGE_LENGTH);
#endif
void* tag(int i) { return (void*)static_cast<intptr_t>(i); } void* tag(int i) { return (void*)static_cast<intptr_t>(i); }
int detag(void* p) { return static_cast<int>(reinterpret_cast<intptr_t>(p)); } int detag(void* p) { return static_cast<int>(reinterpret_cast<intptr_t>(p)); }
@ -231,17 +218,6 @@ class ServerBuilderSyncPluginDisabler : public ::grpc::ServerBuilderOption {
} }
}; };
class ServerBuilderMaxRecvMessageSizeOption
: public ::grpc::ServerBuilderOption {
public:
void UpdateArguments(ChannelArguments* arg) override {
arg->SetInt(GRPC_ARG_MAX_RECEIVE_MESSAGE_LENGTH, -1);
}
void UpdatePlugins(
std::vector<std::unique_ptr<ServerBuilderPlugin>>* plugins) override {}
};
class TestScenario { class TestScenario {
public: public:
TestScenario(bool inproc_stub, const grpc::string& creds_type, bool hcs, TestScenario(bool inproc_stub, const grpc::string& creds_type, bool hcs,
@ -314,9 +290,6 @@ class AsyncEnd2endTest : public ::testing::TestWithParam<TestScenario> {
std::unique_ptr<ServerBuilderOption> sync_plugin_disabler( std::unique_ptr<ServerBuilderOption> sync_plugin_disabler(
new ServerBuilderSyncPluginDisabler()); new ServerBuilderSyncPluginDisabler());
builder.SetOption(move(sync_plugin_disabler)); builder.SetOption(move(sync_plugin_disabler));
std::unique_ptr<ServerBuilderOption> max_recv_option(
new ServerBuilderMaxRecvMessageSizeOption());
builder.SetOption(move(max_recv_option));
server_ = builder.BuildAndStart(); server_ = builder.BuildAndStart();
} }
@ -324,7 +297,6 @@ class AsyncEnd2endTest : public ::testing::TestWithParam<TestScenario> {
ChannelArguments args; ChannelArguments args;
auto channel_creds = GetCredentialsProvider()->GetChannelCredentials( auto channel_creds = GetCredentialsProvider()->GetChannelCredentials(
GetParam().credentials_type, &args); GetParam().credentials_type, &args);
args.SetInt(GRPC_ARG_MAX_RECEIVE_MESSAGE_LENGTH, -1);
std::shared_ptr<Channel> channel = std::shared_ptr<Channel> channel =
!(GetParam().inproc) ? ::grpc::CreateCustomChannel( !(GetParam().inproc) ? ::grpc::CreateCustomChannel(
server_address_.str(), channel_creds, args) server_address_.str(), channel_creds, args)
@ -1850,7 +1822,7 @@ TEST_P(AsyncEnd2endServerTryCancelTest, ServerBidiStreamingTryCancelAfter) {
} }
std::vector<TestScenario> CreateTestScenarios(bool test_secure, std::vector<TestScenario> CreateTestScenarios(bool test_secure,
bool test_big_message) { bool test_message_size_limit) {
std::vector<TestScenario> scenarios; std::vector<TestScenario> scenarios;
std::vector<grpc::string> credentials_types; std::vector<grpc::string> credentials_types;
std::vector<grpc::string> messages; std::vector<grpc::string> messages;
@ -1872,8 +1844,9 @@ std::vector<TestScenario> CreateTestScenarios(bool test_secure,
GPR_ASSERT(!credentials_types.empty()); GPR_ASSERT(!credentials_types.empty());
messages.push_back("Hello"); messages.push_back("Hello");
if (test_big_message) { if (test_message_size_limit) {
for (size_t k = 1; k < MAX_TEST_MESSAGE_SIZE / 1024; k *= 32) { for (size_t k = 1; k < GRPC_DEFAULT_MAX_RECV_MESSAGE_LENGTH / 1024;
k *= 32) {
grpc::string big_msg; grpc::string big_msg;
for (size_t i = 0; i < k * 1024; ++i) { for (size_t i = 0; i < k * 1024; ++i) {
char c = 'a' + (i % 26); char c = 'a' + (i % 26);
@ -1881,7 +1854,8 @@ std::vector<TestScenario> CreateTestScenarios(bool test_secure,
} }
messages.push_back(big_msg); messages.push_back(big_msg);
} }
messages.push_back(grpc::string(MAX_TEST_MESSAGE_SIZE - 10, 'a')); messages.push_back(
grpc::string(GRPC_DEFAULT_MAX_RECV_MESSAGE_LENGTH - 10, 'a'));
} }
// TODO (sreek) Renable tests with health check service after the issue // TODO (sreek) Renable tests with health check service after the issue

@ -1 +1 @@
Subproject commit e776aa0275e293707b6a0901e0e8d8a8a3679508 Subproject commit 090faecb454fbd6e6e17a75ef8146acb037118d4

@ -27,7 +27,7 @@ want_submodules=$(mktemp /tmp/submXXXXXX)
git submodule | awk '{ print $1 }' | sort > "$submodules" git submodule | awk '{ print $1 }' | sort > "$submodules"
cat << EOF | awk '{ print $1 }' | sort > "$want_submodules" cat << EOF | awk '{ print $1 }' | sort > "$want_submodules"
74d91756c11bc22f9b0108b94da9326f7f9e376f third_party/abseil-cpp (74d9175) 74d91756c11bc22f9b0108b94da9326f7f9e376f third_party/abseil-cpp (74d9175)
e776aa0275e293707b6a0901e0e8d8a8a3679508 third_party/benchmark (v1.2.0) 090faecb454fbd6e6e17a75ef8146acb037118d4 third_party/benchmark (v1.5.0)
73594cde8c9a52a102c4341c244c833aa61b9c06 third_party/bloaty (remotes/origin/wide-14-g73594cd) 73594cde8c9a52a102c4341c244c833aa61b9c06 third_party/bloaty (remotes/origin/wide-14-g73594cd)
b29b21a81b32ec273f118f589f46d56ad3332420 third_party/boringssl (remotes/origin/chromium-stable) b29b21a81b32ec273f118f589f46d56ad3332420 third_party/boringssl (remotes/origin/chromium-stable)
afc30d43eef92979b05776ec0963c9cede5fb80f third_party/boringssl-with-bazel (fips-20180716-116-gafc30d43e) afc30d43eef92979b05776ec0963c9cede5fb80f third_party/boringssl-with-bazel (fips-20180716-116-gafc30d43e)

Loading…
Cancel
Save