Merge pull request #19599 from JamesNK/jamesnk/channelbase

Add ChannelBase, change ClientBase constructor argument
pull/19786/head
Jan Tattermusch 6 years ago committed by GitHub
commit e0de9e2ef6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      src/compiler/csharp_generator.cc
  2. 52
      src/csharp/Grpc.Core.Api/ChannelBase.cs
  3. 4
      src/csharp/Grpc.Core.Api/ClientBase.cs
  4. 60
      src/csharp/Grpc.Core.Api/Internal/UnimplementedCallInvoker.cs
  5. 36
      src/csharp/Grpc.Core.Api/LiteClientBase.cs
  6. 24
      src/csharp/Grpc.Core/Channel.cs
  7. 2
      src/csharp/Grpc.Core/ForwardedTypes.cs
  8. 2
      src/csharp/Grpc.Examples/MathGrpc.cs
  9. 3
      src/csharp/Grpc.HealthCheck.Tests/Grpc.HealthCheck.Tests.csproj
  10. 4
      src/csharp/Grpc.HealthCheck/Grpc.HealthCheck.csproj
  11. 2
      src/csharp/Grpc.HealthCheck/HealthGrpc.cs
  12. 2
      src/csharp/Grpc.IntegrationTesting/BenchmarkServiceGrpc.cs
  13. 2
      src/csharp/Grpc.IntegrationTesting/EmptyServiceGrpc.cs
  14. 110
      src/csharp/Grpc.IntegrationTesting/Messages.cs
  15. 2
      src/csharp/Grpc.IntegrationTesting/MetricsGrpc.cs
  16. 2
      src/csharp/Grpc.IntegrationTesting/ReportQpsScenarioServiceGrpc.cs
  17. 6
      src/csharp/Grpc.IntegrationTesting/TestGrpc.cs
  18. 2
      src/csharp/Grpc.IntegrationTesting/WorkerServiceGrpc.cs
  19. 3
      src/csharp/Grpc.Reflection.Tests/Grpc.Reflection.Tests.csproj
  20. 2
      src/csharp/Grpc.Reflection/Grpc.Reflection.csproj
  21. 2
      src/csharp/Grpc.Reflection/ReflectionGrpc.cs

@ -437,8 +437,8 @@ void GenerateClientStub(Printer* out, const ServiceDescriptor* service,
"/// <param name=\"channel\">The channel to use to make remote "
"calls.</param>\n",
"servicename", GetServiceClassName(service));
out->Print("public $name$(grpc::Channel channel) : base(channel)\n", "name",
GetClientClassName(service));
out->Print("public $name$(grpc::ChannelBase channel) : base(channel)\n",
"name", GetClientClassName(service));
out->Print("{\n");
out->Print("}\n");
}

@ -0,0 +1,52 @@
#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.Utils;
namespace Grpc.Core
{
/// <summary>
/// Base class for gRPC channel. Channels are an abstraction of long-lived connections to remote servers.
/// </summary>
public abstract class ChannelBase
{
private readonly string target;
/// <summary>
/// Initializes a new instance of <see cref="ChannelBase"/> class that connects to a specific host.
/// </summary>
/// <param name="target">Target of the channel.</param>
protected ChannelBase(string target)
{
this.target = GrpcPreconditions.CheckNotNull(target, nameof(target));
}
/// <summary>The original target used to create the channel.</summary>
public string Target
{
get { return this.target; }
}
/// <summary>
/// Create a new <see cref="CallInvoker"/> for the channel.
/// </summary>
/// <returns>A new <see cref="CallInvoker"/>.</returns>
public abstract CallInvoker CreateCallInvoker();
}
}

@ -51,7 +51,7 @@ namespace Grpc.Core
/// Initializes a new instance of <c>ClientBase</c> class.
/// </summary>
/// <param name="channel">The channel to use for remote call invocation.</param>
public ClientBase(Channel channel) : base(channel)
public ClientBase(ChannelBase channel) : base(channel)
{
}
@ -113,7 +113,7 @@ namespace Grpc.Core
/// Initializes a new instance of <c>ClientBase</c> class.
/// </summary>
/// <param name="channel">The channel to use for remote call invocation.</param>
public ClientBase(Channel channel) : this(new DefaultCallInvoker(channel))
public ClientBase(ChannelBase channel) : this(channel.CreateCallInvoker())
{
}

@ -0,0 +1,60 @@
#region Copyright notice and license
// 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.
// See the License for the specific language governing permissions and
// limitations under the License.
#endregion
using System;
using System.Threading.Tasks;
using Grpc.Core;
using Grpc.Core.Utils;
namespace Grpc.Core.Internal
{
/// <summary>
/// Call invoker that throws <c>NotImplementedException</c> for all requests.
/// </summary>
internal class UnimplementedCallInvoker : CallInvoker
{
public UnimplementedCallInvoker()
{
}
public override TResponse BlockingUnaryCall<TRequest, TResponse>(Method<TRequest, TResponse> method, string host, CallOptions options, TRequest request)
{
throw new NotImplementedException();
}
public override AsyncUnaryCall<TResponse> AsyncUnaryCall<TRequest, TResponse>(Method<TRequest, TResponse> method, string host, CallOptions options, TRequest request)
{
throw new NotImplementedException();
}
public override AsyncServerStreamingCall<TResponse> AsyncServerStreamingCall<TRequest, TResponse>(Method<TRequest, TResponse> method, string host, CallOptions options, TRequest request)
{
throw new NotImplementedException();
}
public override AsyncClientStreamingCall<TRequest, TResponse> AsyncClientStreamingCall<TRequest, TResponse>(Method<TRequest, TResponse> method, string host, CallOptions options)
{
throw new NotImplementedException();
}
public override AsyncDuplexStreamingCall<TRequest, TResponse> AsyncDuplexStreamingCall<TRequest, TResponse>(Method<TRequest, TResponse> method, string host, CallOptions options)
{
throw new NotImplementedException();
}
}
}

@ -17,6 +17,7 @@
#endregion
using System;
using Grpc.Core.Internal;
using Grpc.Core.Utils;
namespace Grpc.Core
@ -58,40 +59,5 @@ namespace Grpc.Core
{
get { return this.callInvoker; }
}
/// <summary>
/// Call invoker that throws <c>NotImplementedException</c> for all requests.
/// </summary>
private class UnimplementedCallInvoker : CallInvoker
{
public UnimplementedCallInvoker()
{
}
public override TResponse BlockingUnaryCall<TRequest, TResponse>(Method<TRequest, TResponse> method, string host, CallOptions options, TRequest request)
{
throw new NotImplementedException();
}
public override AsyncUnaryCall<TResponse> AsyncUnaryCall<TRequest, TResponse>(Method<TRequest, TResponse> method, string host, CallOptions options, TRequest request)
{
throw new NotImplementedException();
}
public override AsyncServerStreamingCall<TResponse> AsyncServerStreamingCall<TRequest, TResponse>(Method<TRequest, TResponse> method, string host, CallOptions options, TRequest request)
{
throw new NotImplementedException();
}
public override AsyncClientStreamingCall<TRequest, TResponse> AsyncClientStreamingCall<TRequest, TResponse>(Method<TRequest, TResponse> method, string host, CallOptions options)
{
throw new NotImplementedException();
}
public override AsyncDuplexStreamingCall<TRequest, TResponse> AsyncDuplexStreamingCall<TRequest, TResponse>(Method<TRequest, TResponse> method, string host, CallOptions options)
{
throw new NotImplementedException();
}
}
}
}

@ -30,7 +30,7 @@ namespace Grpc.Core
/// More client objects can reuse the same channel. Creating a channel is an expensive operation compared to invoking
/// a remote call so in general you should reuse a single channel for as many calls as possible.
/// </summary>
public class Channel
public class Channel : ChannelBase
{
static readonly ILogger Logger = GrpcEnvironment.Logger.ForType<Channel>();
@ -38,7 +38,6 @@ namespace Grpc.Core
readonly AtomicCounter activeCallCounter = new AtomicCounter();
readonly CancellationTokenSource shutdownTokenSource = new CancellationTokenSource();
readonly string target;
readonly GrpcEnvironment environment;
readonly CompletionQueueSafeHandle completionQueue;
readonly ChannelSafeHandle handle;
@ -64,9 +63,8 @@ namespace Grpc.Core
/// <param name="target">Target of the channel.</param>
/// <param name="credentials">Credentials to secure the channel.</param>
/// <param name="options">Channel options.</param>
public Channel(string target, ChannelCredentials credentials, IEnumerable<ChannelOption> options)
public Channel(string target, ChannelCredentials credentials, IEnumerable<ChannelOption> options) : base(target)
{
this.target = GrpcPreconditions.CheckNotNull(target, "target");
this.options = CreateOptionsDictionary(options);
EnsureUserAgentChannelOption(this.options);
this.environment = GrpcEnvironment.AddRef();
@ -179,15 +177,6 @@ namespace Grpc.Core
}
}
/// <summary>The original target used to create the channel.</summary>
public string Target
{
get
{
return this.target;
}
}
/// <summary>
/// Returns a token that gets cancelled once <c>ShutdownAsync</c> is invoked.
/// </summary>
@ -257,6 +246,15 @@ namespace Grpc.Core
await GrpcEnvironment.ReleaseAsync().ConfigureAwait(false);
}
/// <summary>
/// Create a new <see cref="CallInvoker"/> for the channel.
/// </summary>
/// <returns>A new <see cref="CallInvoker"/>.</returns>
public override CallInvoker CreateCallInvoker()
{
return new DefaultCallInvoker(this);
}
internal ChannelSafeHandle Handle
{
get

@ -38,6 +38,8 @@ using Grpc.Core.Utils;
[assembly:TypeForwardedToAttribute(typeof(CallInvoker))]
[assembly:TypeForwardedToAttribute(typeof(CallInvokerExtensions))]
[assembly:TypeForwardedToAttribute(typeof(CallOptions))]
[assembly:TypeForwardedToAttribute(typeof(ClientBase))]
[assembly:TypeForwardedToAttribute(typeof(ClientBase<>))]
[assembly:TypeForwardedToAttribute(typeof(ClientInterceptorContext<,>))]
[assembly:TypeForwardedToAttribute(typeof(ContextPropagationOptions))]
[assembly:TypeForwardedToAttribute(typeof(ContextPropagationToken))]

@ -130,7 +130,7 @@ namespace Math {
{
/// <summary>Creates a new client for Math</summary>
/// <param name="channel">The channel to use to make remote calls.</param>
public MathClient(grpc::Channel channel) : base(channel)
public MathClient(grpc::ChannelBase channel) : base(channel)
{
}
/// <summary>Creates a new client for Math that uses a custom <c>CallInvoker</c>.</summary>

@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\Grpc.Core\Common.csproj.include" />
@ -10,6 +10,7 @@
<ItemGroup>
<ProjectReference Include="../Grpc.HealthCheck/Grpc.HealthCheck.csproj" />
<ProjectReference Include="../Grpc.Core/Grpc.Core.csproj" />
</ItemGroup>
<ItemGroup>

@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\Grpc.Core\Common.csproj.include" />
@ -26,7 +26,7 @@
</ItemGroup>
<ItemGroup>
<ProjectReference Include="../Grpc.Core/Grpc.Core.csproj">
<ProjectReference Include="../Grpc.Core.Api/Grpc.Core.Api.csproj">
<PrivateAssets>None</PrivateAssets>
</ProjectReference>
</ItemGroup>

@ -102,7 +102,7 @@ namespace Grpc.Health.V1 {
{
/// <summary>Creates a new client for Health</summary>
/// <param name="channel">The channel to use to make remote calls.</param>
public HealthClient(grpc::Channel channel) : base(channel)
public HealthClient(grpc::ChannelBase channel) : base(channel)
{
}
/// <summary>Creates a new client for Health that uses a custom <c>CallInvoker</c>.</summary>

@ -148,7 +148,7 @@ namespace Grpc.Testing {
{
/// <summary>Creates a new client for BenchmarkService</summary>
/// <param name="channel">The channel to use to make remote calls.</param>
public BenchmarkServiceClient(grpc::Channel channel) : base(channel)
public BenchmarkServiceClient(grpc::ChannelBase channel) : base(channel)
{
}
/// <summary>Creates a new client for BenchmarkService that uses a custom <c>CallInvoker</c>.</summary>

@ -49,7 +49,7 @@ namespace Grpc.Testing {
{
/// <summary>Creates a new client for EmptyService</summary>
/// <param name="channel">The channel to use to make remote calls.</param>
public EmptyServiceClient(grpc::Channel channel) : base(channel)
public EmptyServiceClient(grpc::ChannelBase channel) : base(channel)
{
}
/// <summary>Creates a new client for EmptyService that uses a custom <c>CallInvoker</c>.</summary>

@ -28,41 +28,42 @@ namespace Grpc.Testing {
"LnRlc3RpbmciGgoJQm9vbFZhbHVlEg0KBXZhbHVlGAEgASgIIkAKB1BheWxv",
"YWQSJwoEdHlwZRgBIAEoDjIZLmdycGMudGVzdGluZy5QYXlsb2FkVHlwZRIM",
"CgRib2R5GAIgASgMIisKCkVjaG9TdGF0dXMSDAoEY29kZRgBIAEoBRIPCgdt",
"ZXNzYWdlGAIgASgJIs4CCg1TaW1wbGVSZXF1ZXN0EjAKDXJlc3BvbnNlX3R5",
"ZXNzYWdlGAIgASgJIuYCCg1TaW1wbGVSZXF1ZXN0EjAKDXJlc3BvbnNlX3R5",
"cGUYASABKA4yGS5ncnBjL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MSDAoEc2l6ZRgBIAEoBRITCgtpbnRlcnZh",
"bF91cxgCIAEoBRIrCgpjb21wcmVzc2VkGAMgASgLMhcuZ3JwYy50ZXN0aW5n",
"LkJvb2xWYWx1ZSLoAQoaU3RyZWFtaW5nT3V0cHV0Q2FsbFJlcXVlc3QSMAoN",
"cmVzcG9uc2VfdHlwZRgBIAEoDjIZLmdycGMudGVzdGluZy5QYXlsb2FkVHlw",
"ZRI9ChNyZXNwb25zZV9wYXJhbWV0ZXJzGAIgAygLMiAuZ3JwYy50ZXN0aW5n",
"LlJlc3BvbnNlUGFyYW1ldGVycxImCgdwYXlsb2FkGAMgASgLMhUuZ3JwYy50",
"ZXN0aW5nLlBheWxvYWQSMQoPcmVzcG9uc2Vfc3RhdHVzGAcgASgLMhguZ3Jw",
"Yy50ZXN0aW5nLkVjaG9TdGF0dXMiRQobU3RyZWFtaW5nT3V0cHV0Q2FsbFJl",
"c3BvbnNlEiYKB3BheWxvYWQYASABKAsyFS5ncnBjLnRlc3RpbmcuUGF5bG9h",
"ZCIzCg9SZWNvbm5lY3RQYXJhbXMSIAoYbWF4X3JlY29ubmVjdF9iYWNrb2Zm",
"X21zGAEgASgFIjMKDVJlY29ubmVjdEluZm8SDgoGcGFzc2VkGAEgASgIEhIK",
"CmJhY2tvZmZfbXMYAiADKAUqHwoLUGF5bG9hZFR5cGUSEAoMQ09NUFJFU1NB",
"QkxFEABiBnByb3RvMw=="));
descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
new pbr::FileDescriptor[] { },
new pbr::GeneratedClrTypeInfo(new[] {typeof(global::Grpc.Testing.PayloadType), }, 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.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.SimpleRequest), global::Grpc.Testing.SimpleRequest.Parser, new[]{ "ResponseType", "ResponseSize", "Payload", "FillUsername", "FillOauthScope", "ResponseCompressed", "ResponseStatus", "ExpectCompressed" }, null, null, null),
new pbr::GeneratedClrTypeInfo(typeof(global::Grpc.Testing.SimpleResponse), global::Grpc.Testing.SimpleResponse.Parser, new[]{ "Payload", "Username", "OauthScope" }, 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.SimpleResponse), global::Grpc.Testing.SimpleResponse.Parser, new[]{ "Payload", "Username", "OauthScope", "ServerId" }, 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.ResponseParameters), global::Grpc.Testing.ResponseParameters.Parser, new[]{ "Size", "IntervalUs", "Compressed" }, null, null, null),
@ -589,6 +590,7 @@ namespace Grpc.Testing {
responseCompressed_ = other.responseCompressed_ != null ? other.responseCompressed_.Clone() : null;
responseStatus_ = other.responseStatus_ != null ? other.responseStatus_.Clone() : null;
expectCompressed_ = other.expectCompressed_ != null ? other.expectCompressed_.Clone() : null;
fillServerId_ = other.fillServerId_;
_unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
}
@ -713,6 +715,20 @@ namespace Grpc.Testing {
}
}
/// <summary>Field number for the "fill_server_id" field.</summary>
public const int FillServerIdFieldNumber = 9;
private bool fillServerId_;
/// <summary>
/// Whether SimpleResponse should include server_id.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool FillServerId {
get { return fillServerId_; }
set {
fillServerId_ = value;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override bool Equals(object other) {
return Equals(other as SimpleRequest);
@ -734,6 +750,7 @@ namespace Grpc.Testing {
if (!object.Equals(ResponseCompressed, other.ResponseCompressed)) return false;
if (!object.Equals(ResponseStatus, other.ResponseStatus)) return false;
if (!object.Equals(ExpectCompressed, other.ExpectCompressed)) return false;
if (FillServerId != other.FillServerId) return false;
return Equals(_unknownFields, other._unknownFields);
}
@ -748,6 +765,7 @@ namespace Grpc.Testing {
if (responseCompressed_ != null) hash ^= ResponseCompressed.GetHashCode();
if (responseStatus_ != null) hash ^= ResponseStatus.GetHashCode();
if (expectCompressed_ != null) hash ^= ExpectCompressed.GetHashCode();
if (FillServerId != false) hash ^= FillServerId.GetHashCode();
if (_unknownFields != null) {
hash ^= _unknownFields.GetHashCode();
}
@ -793,6 +811,10 @@ namespace Grpc.Testing {
output.WriteRawTag(66);
output.WriteMessage(ExpectCompressed);
}
if (FillServerId != false) {
output.WriteRawTag(72);
output.WriteBool(FillServerId);
}
if (_unknownFields != null) {
_unknownFields.WriteTo(output);
}
@ -825,6 +847,9 @@ namespace Grpc.Testing {
if (expectCompressed_ != null) {
size += 1 + pb::CodedOutputStream.ComputeMessageSize(ExpectCompressed);
}
if (FillServerId != false) {
size += 1 + 1;
}
if (_unknownFields != null) {
size += _unknownFields.CalculateSize();
}
@ -872,6 +897,9 @@ namespace Grpc.Testing {
}
ExpectCompressed.MergeFrom(other.ExpectCompressed);
}
if (other.FillServerId != false) {
FillServerId = other.FillServerId;
}
_unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
}
@ -927,6 +955,10 @@ namespace Grpc.Testing {
input.ReadMessage(ExpectCompressed);
break;
}
case 72: {
FillServerId = input.ReadBool();
break;
}
}
}
}
@ -964,6 +996,7 @@ namespace Grpc.Testing {
payload_ = other.payload_ != null ? other.payload_.Clone() : null;
username_ = other.username_;
oauthScope_ = other.oauthScope_;
serverId_ = other.serverId_;
_unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
}
@ -1015,6 +1048,21 @@ namespace Grpc.Testing {
}
}
/// <summary>Field number for the "server_id" field.</summary>
public const int ServerIdFieldNumber = 4;
private string serverId_ = "";
/// <summary>
/// Server ID. This must be unique among different server instances,
/// but the same across all RPC's made to a particular server instance.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public string ServerId {
get { return serverId_; }
set {
serverId_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override bool Equals(object other) {
return Equals(other as SimpleResponse);
@ -1031,6 +1079,7 @@ namespace Grpc.Testing {
if (!object.Equals(Payload, other.Payload)) return false;
if (Username != other.Username) return false;
if (OauthScope != other.OauthScope) return false;
if (ServerId != other.ServerId) return false;
return Equals(_unknownFields, other._unknownFields);
}
@ -1040,6 +1089,7 @@ namespace Grpc.Testing {
if (payload_ != null) hash ^= Payload.GetHashCode();
if (Username.Length != 0) hash ^= Username.GetHashCode();
if (OauthScope.Length != 0) hash ^= OauthScope.GetHashCode();
if (ServerId.Length != 0) hash ^= ServerId.GetHashCode();
if (_unknownFields != null) {
hash ^= _unknownFields.GetHashCode();
}
@ -1065,6 +1115,10 @@ namespace Grpc.Testing {
output.WriteRawTag(26);
output.WriteString(OauthScope);
}
if (ServerId.Length != 0) {
output.WriteRawTag(34);
output.WriteString(ServerId);
}
if (_unknownFields != null) {
_unknownFields.WriteTo(output);
}
@ -1082,6 +1136,9 @@ namespace Grpc.Testing {
if (OauthScope.Length != 0) {
size += 1 + pb::CodedOutputStream.ComputeStringSize(OauthScope);
}
if (ServerId.Length != 0) {
size += 1 + pb::CodedOutputStream.ComputeStringSize(ServerId);
}
if (_unknownFields != null) {
size += _unknownFields.CalculateSize();
}
@ -1105,6 +1162,9 @@ namespace Grpc.Testing {
if (other.OauthScope.Length != 0) {
OauthScope = other.OauthScope;
}
if (other.ServerId.Length != 0) {
ServerId = other.ServerId;
}
_unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
}
@ -1131,6 +1191,10 @@ namespace Grpc.Testing {
OauthScope = input.ReadString();
break;
}
case 34: {
ServerId = input.ReadString();
break;
}
}
}
}

@ -92,7 +92,7 @@ namespace Grpc.Testing {
{
/// <summary>Creates a new client for MetricsService</summary>
/// <param name="channel">The channel to use to make remote calls.</param>
public MetricsServiceClient(grpc::Channel channel) : base(channel)
public MetricsServiceClient(grpc::ChannelBase channel) : base(channel)
{
}
/// <summary>Creates a new client for MetricsService that uses a custom <c>CallInvoker</c>.</summary>

@ -67,7 +67,7 @@ namespace Grpc.Testing {
{
/// <summary>Creates a new client for ReportQpsScenarioService</summary>
/// <param name="channel">The channel to use to make remote calls.</param>
public ReportQpsScenarioServiceClient(grpc::Channel channel) : base(channel)
public ReportQpsScenarioServiceClient(grpc::ChannelBase channel) : base(channel)
{
}
/// <summary>Creates a new client for ReportQpsScenarioService that uses a custom <c>CallInvoker</c>.</summary>

@ -216,7 +216,7 @@ namespace Grpc.Testing {
{
/// <summary>Creates a new client for TestService</summary>
/// <param name="channel">The channel to use to make remote calls.</param>
public TestServiceClient(grpc::Channel channel) : base(channel)
public TestServiceClient(grpc::ChannelBase channel) : base(channel)
{
}
/// <summary>Creates a new client for TestService that uses a custom <c>CallInvoker</c>.</summary>
@ -602,7 +602,7 @@ namespace Grpc.Testing {
{
/// <summary>Creates a new client for UnimplementedService</summary>
/// <param name="channel">The channel to use to make remote calls.</param>
public UnimplementedServiceClient(grpc::Channel channel) : base(channel)
public UnimplementedServiceClient(grpc::ChannelBase channel) : base(channel)
{
}
/// <summary>Creates a new client for UnimplementedService that uses a custom <c>CallInvoker</c>.</summary>
@ -741,7 +741,7 @@ namespace Grpc.Testing {
{
/// <summary>Creates a new client for ReconnectService</summary>
/// <param name="channel">The channel to use to make remote calls.</param>
public ReconnectServiceClient(grpc::Channel channel) : base(channel)
public ReconnectServiceClient(grpc::ChannelBase channel) : base(channel)
{
}
/// <summary>Creates a new client for ReconnectService that uses a custom <c>CallInvoker</c>.</summary>

@ -138,7 +138,7 @@ namespace Grpc.Testing {
{
/// <summary>Creates a new client for WorkerService</summary>
/// <param name="channel">The channel to use to make remote calls.</param>
public WorkerServiceClient(grpc::Channel channel) : base(channel)
public WorkerServiceClient(grpc::ChannelBase channel) : base(channel)
{
}
/// <summary>Creates a new client for WorkerService that uses a custom <c>CallInvoker</c>.</summary>

@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\Grpc.Core\Common.csproj.include" />
@ -10,6 +10,7 @@
<ItemGroup>
<ProjectReference Include="../Grpc.Reflection/Grpc.Reflection.csproj" />
<ProjectReference Include="../Grpc.Core/Grpc.Core.csproj" />
</ItemGroup>
<ItemGroup>

@ -26,7 +26,7 @@
</ItemGroup>
<ItemGroup>
<ProjectReference Include="../Grpc.Core/Grpc.Core.csproj">
<ProjectReference Include="../Grpc.Core.Api/Grpc.Core.Api.csproj">
<PrivateAssets>None</PrivateAssets>
</ProjectReference>
</ItemGroup>

@ -69,7 +69,7 @@ namespace Grpc.Reflection.V1Alpha {
{
/// <summary>Creates a new client for ServerReflection</summary>
/// <param name="channel">The channel to use to make remote calls.</param>
public ServerReflectionClient(grpc::Channel channel) : base(channel)
public ServerReflectionClient(grpc::ChannelBase channel) : base(channel)
{
}
/// <summary>Creates a new client for ServerReflection that uses a custom <c>CallInvoker</c>.</summary>

Loading…
Cancel
Save