Merge pull request #2863 from jtattermusch/csharp_upgrade_to_proto3

Upgrade C# to proto3
pull/3105/head
Michael Lumish 10 years ago
commit 9a97a096ce
  1. 59
      src/compiler/csharp_generator.cc
  2. 5
      src/compiler/csharp_generator.h
  3. 3
      src/csharp/.gitignore
  4. 4
      src/csharp/Grpc.Core/VersionInfo.cs
  5. 2
      src/csharp/Grpc.Examples.MathClient/MathClient.cs
  6. 2
      src/csharp/Grpc.Examples.MathServer/MathServer.cs
  7. 7
      src/csharp/Grpc.Examples.Tests/Grpc.Examples.Tests.csproj
  8. 26
      src/csharp/Grpc.Examples.Tests/MathClientServerTests.cs
  9. 2
      src/csharp/Grpc.Examples.Tests/packages.config
  10. 7
      src/csharp/Grpc.Examples/Grpc.Examples.csproj
  11. 1651
      src/csharp/Grpc.Examples/Math.cs
  12. 28
      src/csharp/Grpc.Examples/MathExamples.cs
  13. 72
      src/csharp/Grpc.Examples/MathGrpc.cs
  14. 10
      src/csharp/Grpc.Examples/MathServiceImpl.cs
  15. 2
      src/csharp/Grpc.Examples/packages.config
  16. 16
      src/csharp/Grpc.Examples/proto/math.proto
  17. 8
      src/csharp/Grpc.HealthCheck.Tests/Grpc.HealthCheck.Tests.csproj
  18. 4
      src/csharp/Grpc.HealthCheck.Tests/HealthClientServerTest.cs
  19. 2
      src/csharp/Grpc.HealthCheck.Tests/HealthServiceImplTest.cs
  20. 2
      src/csharp/Grpc.HealthCheck.Tests/packages.config
  21. 8
      src/csharp/Grpc.HealthCheck/Grpc.HealthCheck.csproj
  22. 2
      src/csharp/Grpc.HealthCheck/Grpc.HealthCheck.nuspec
  23. 716
      src/csharp/Grpc.HealthCheck/Health.cs
  24. 10
      src/csharp/Grpc.HealthCheck/HealthGrpc.cs
  25. 6
      src/csharp/Grpc.HealthCheck/HealthServiceImpl.cs
  26. 2
      src/csharp/Grpc.HealthCheck/packages.config
  27. 8
      src/csharp/Grpc.HealthCheck/proto/health.proto
  28. 284
      src/csharp/Grpc.IntegrationTesting/Empty.cs
  29. 16
      src/csharp/Grpc.IntegrationTesting/Grpc.IntegrationTesting.csproj
  30. 152
      src/csharp/Grpc.IntegrationTesting/InteropClient.cs
  31. 2
      src/csharp/Grpc.IntegrationTesting/InteropClientServerTest.cs
  32. 3
      src/csharp/Grpc.IntegrationTesting/InteropServer.cs
  33. 3213
      src/csharp/Grpc.IntegrationTesting/Messages.cs
  34. 4
      src/csharp/Grpc.IntegrationTesting/SslCredentialsTest.cs
  35. 48
      src/csharp/Grpc.IntegrationTesting/Test.cs
  36. 2
      src/csharp/Grpc.IntegrationTesting/TestCredentials.cs
  37. 110
      src/csharp/Grpc.IntegrationTesting/TestGrpc.cs
  38. 23
      src/csharp/Grpc.IntegrationTesting/TestServiceImpl.cs
  39. 1
      src/csharp/Grpc.IntegrationTesting/packages.config
  40. 2
      src/csharp/Grpc.IntegrationTesting/proto/empty.proto
  41. 36
      src/csharp/Grpc.IntegrationTesting/proto/messages.proto
  42. 2
      src/csharp/Grpc.IntegrationTesting/proto/test.proto
  43. 7
      src/csharp/Grpc.Tools.nuspec
  44. 9
      src/csharp/build_packages.bat
  45. 8
      src/csharp/generate_proto_csharp.sh
  46. 2
      templates/vsprojects/vcxproj_defs.include
  47. 2
      third_party/protobuf
  48. 2
      tools/run_tests/run_sanity.sh
  49. 13
      vsprojects/README.md
  50. 23
      vsprojects/build_plugins.bat
  51. 1
      vsprojects/grpc_cpp_plugin/grpc_cpp_plugin.vcxproj
  52. 1
      vsprojects/grpc_csharp_plugin/grpc_csharp_plugin.vcxproj
  53. 1
      vsprojects/grpc_objective_c_plugin/grpc_objective_c_plugin.vcxproj
  54. 1
      vsprojects/grpc_python_plugin/grpc_python_plugin.vcxproj
  55. 1
      vsprojects/grpc_ruby_plugin/grpc_ruby_plugin.vcxproj
  56. 2
      vsprojects/protobuf.props
  57. 2
      vsprojects/protoc.props

@ -35,10 +35,16 @@
#include <map> #include <map>
#include <vector> #include <vector>
#include "src/compiler/csharp_generator.h"
#include "src/compiler/config.h" #include "src/compiler/config.h"
#include "src/compiler/csharp_generator_helpers.h" #include "src/compiler/csharp_generator_helpers.h"
#include "src/compiler/csharp_generator.h" #include "src/compiler/csharp_generator.h"
using google::protobuf::compiler::csharp::GetFileNamespace;
using google::protobuf::compiler::csharp::GetClassName;
using google::protobuf::compiler::csharp::GetUmbrellaClassName;
using google::protobuf::SimpleItoa;
using grpc::protobuf::FileDescriptor; using grpc::protobuf::FileDescriptor;
using grpc::protobuf::Descriptor; using grpc::protobuf::Descriptor;
using grpc::protobuf::ServiceDescriptor; using grpc::protobuf::ServiceDescriptor;
@ -55,47 +61,10 @@ using grpc_generator::StringReplace;
using std::map; using std::map;
using std::vector; using std::vector;
namespace grpc_csharp_generator { namespace grpc_csharp_generator {
namespace { namespace {
// TODO(jtattermusch): make GetFileNamespace part of libprotoc public API.
// NOTE: Implementation needs to match exactly to GetFileNamespace
// defined in csharp_helpers.h in protoc csharp plugin.
// We cannot reference it directly because google3 protobufs
// don't have a csharp protoc plugin.
std::string GetFileNamespace(const FileDescriptor* file) {
if (file->options().has_csharp_namespace()) {
return file->options().csharp_namespace();
}
return file->package();
}
std::string ToCSharpName(const std::string& name, const FileDescriptor* file) {
std::string result = GetFileNamespace(file);
if (result != "") {
result += '.';
}
std::string classname;
if (file->package().empty()) {
classname = name;
} else {
// Strip the proto package from full_name since we've replaced it with
// the C# namespace.
classname = name.substr(file->package().size() + 1);
}
result += StringReplace(classname, ".", ".Types.", false);
return "global::" + result;
}
// TODO(jtattermusch): make GetClassName part of libprotoc public API.
// NOTE: Implementation needs to match exactly to GetClassName
// defined in csharp_helpers.h in protoc csharp plugin.
// We cannot reference it directly because google3 protobufs
// don't have a csharp protoc plugin.
std::string GetClassName(const Descriptor* message) {
return ToCSharpName(message->full_name(), message->file());
}
std::string GetServiceClassName(const ServiceDescriptor* service) { std::string GetServiceClassName(const ServiceDescriptor* service) {
return service->name(); return service->name();
} }
@ -229,7 +198,7 @@ void GenerateMarshallerFields(Printer* out, const ServiceDescriptor *service) {
for (size_t i = 0; i < used_messages.size(); i++) { for (size_t i = 0; i < used_messages.size(); i++) {
const Descriptor *message = used_messages[i]; const Descriptor *message = used_messages[i];
out->Print( out->Print(
"static readonly Marshaller<$type$> $fieldname$ = Marshallers.Create((arg) => arg.ToByteArray(), $type$.ParseFrom);\n", "static readonly Marshaller<$type$> $fieldname$ = Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), $type$.Parser.ParseFrom);\n",
"fieldname", GetMarshallerFieldName(message), "type", "fieldname", GetMarshallerFieldName(message), "type",
GetClassName(message)); GetClassName(message));
} }
@ -258,6 +227,16 @@ void GenerateStaticMethodField(Printer* out, const MethodDescriptor *method) {
out->Outdent(); out->Outdent();
} }
void GenerateServiceDescriptorProperty(Printer* out, const ServiceDescriptor *service) {
out->Print("// service descriptor\n");
out->Print("public static global::Google.Protobuf.Reflection.ServiceDescriptor Descriptor\n");
out->Print("{\n");
out->Print(" get { return $umbrella$.Descriptor.Services[$index$]; }\n",
"umbrella", GetUmbrellaClassName(service->file()), "index", SimpleItoa(service->index()));
out->Print("}\n");
out->Print("\n");
}
void GenerateClientInterface(Printer* out, const ServiceDescriptor *service) { void GenerateClientInterface(Printer* out, const ServiceDescriptor *service) {
out->Print("// client interface\n"); out->Print("// client interface\n");
out->Print("public interface $name$\n", "name", out->Print("public interface $name$\n", "name",
@ -504,6 +483,7 @@ void GenerateService(Printer* out, const ServiceDescriptor *service) {
for (int i = 0; i < service->method_count(); i++) { for (int i = 0; i < service->method_count(); i++) {
GenerateStaticMethodField(out, service->method(i)); GenerateStaticMethodField(out, service->method(i));
} }
GenerateServiceDescriptorProperty(out, service);
GenerateClientInterface(out, service); GenerateClientInterface(out, service);
GenerateServerInterface(out, service); GenerateServerInterface(out, service);
GenerateClientStub(out, service); GenerateClientStub(out, service);
@ -539,7 +519,6 @@ grpc::string GetServices(const FileDescriptor *file) {
out.Print("using System.Threading;\n"); out.Print("using System.Threading;\n");
out.Print("using System.Threading.Tasks;\n"); out.Print("using System.Threading.Tasks;\n");
out.Print("using Grpc.Core;\n"); out.Print("using Grpc.Core;\n");
// TODO(jtattermusch): add using for protobuf message classes
out.Print("\n"); out.Print("\n");
out.Print("namespace $namespace$ {\n", "namespace", GetFileNamespace(file)); out.Print("namespace $namespace$ {\n", "namespace", GetFileNamespace(file));

@ -36,6 +36,11 @@
#include "src/compiler/config.h" #include "src/compiler/config.h"
using namespace std;
#include <google/protobuf/compiler/csharp/csharp_names.h>
#include <google/protobuf/stubs/strutil.h>
namespace grpc_csharp_generator { namespace grpc_csharp_generator {
grpc::string GetServices(const grpc::protobuf::FileDescriptor *file); grpc::string GetServices(const grpc::protobuf::FileDescriptor *file);

@ -4,6 +4,9 @@ StyleCop.Cache
test-results test-results
packages packages
Grpc.v12.suo Grpc.v12.suo
Grpc.sdf
TestResult.xml TestResult.xml
/TestResults /TestResults
.vs/
*.nupkg *.nupkg

@ -39,8 +39,8 @@ namespace Grpc.Core
public static class VersionInfo public static class VersionInfo
{ {
/// <summary> /// <summary>
/// Current version of gRPC /// Current version of gRPC C#
/// </summary> /// </summary>
public const string CurrentVersion = "0.6.1"; public const string CurrentVersion = "0.7.0";
} }
} }

@ -33,7 +33,7 @@ using System.Runtime.InteropServices;
using System.Threading; using System.Threading;
using Grpc.Core; using Grpc.Core;
namespace math namespace Math
{ {
class MathClient class MathClient
{ {

@ -34,7 +34,7 @@ using System.Runtime.InteropServices;
using System.Threading; using System.Threading;
using Grpc.Core; using Grpc.Core;
namespace math namespace Math
{ {
class MainClass class MainClass
{ {

@ -37,13 +37,14 @@
<AssemblyOriginatorKeyFile>C:\keys\Grpc.snk</AssemblyOriginatorKeyFile> <AssemblyOriginatorKeyFile>C:\keys\Grpc.snk</AssemblyOriginatorKeyFile>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="Google.Protobuf, Version=3.0.0.0, Culture=neutral, PublicKeyToken=a7d26565bac4d604, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\Google.Protobuf.3.0.0-alpha4\lib\portable-net45+netcore45+wpa81+wp8\Google.Protobuf.dll</HintPath>
</Reference>
<Reference Include="nunit.framework"> <Reference Include="nunit.framework">
<HintPath>..\packages\NUnit.2.6.4\lib\nunit.framework.dll</HintPath> <HintPath>..\packages\NUnit.2.6.4\lib\nunit.framework.dll</HintPath>
</Reference> </Reference>
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="Google.ProtocolBuffers">
<HintPath>..\packages\Google.ProtocolBuffers.2.4.1.521\lib\net40\Google.ProtocolBuffers.dll</HintPath>
</Reference>
<Reference Include="System.Interactive.Async, Version=1.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> <Reference Include="System.Interactive.Async, Version=1.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion> <SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\Ix-Async.1.2.3\lib\net45\System.Interactive.Async.dll</HintPath> <HintPath>..\packages\Ix-Async.1.2.3\lib\net45\System.Interactive.Async.dll</HintPath>

@ -40,7 +40,7 @@ using Grpc.Core;
using Grpc.Core.Utils; using Grpc.Core.Utils;
using NUnit.Framework; using NUnit.Framework;
namespace math.Tests namespace Math.Tests
{ {
/// <summary> /// <summary>
/// Math client talks to local math server. /// Math client talks to local math server.
@ -75,7 +75,7 @@ namespace math.Tests
[Test] [Test]
public void Div1() public void Div1()
{ {
DivReply response = client.Div(new DivArgs.Builder { Dividend = 10, Divisor = 3 }.Build()); DivReply response = client.Div(new DivArgs { Dividend = 10, Divisor = 3 });
Assert.AreEqual(3, response.Quotient); Assert.AreEqual(3, response.Quotient);
Assert.AreEqual(1, response.Remainder); Assert.AreEqual(1, response.Remainder);
} }
@ -83,7 +83,7 @@ namespace math.Tests
[Test] [Test]
public void Div2() public void Div2()
{ {
DivReply response = client.Div(new DivArgs.Builder { Dividend = 0, Divisor = 1 }.Build()); DivReply response = client.Div(new DivArgs { Dividend = 0, Divisor = 1 });
Assert.AreEqual(0, response.Quotient); Assert.AreEqual(0, response.Quotient);
Assert.AreEqual(0, response.Remainder); Assert.AreEqual(0, response.Remainder);
} }
@ -91,14 +91,14 @@ namespace math.Tests
[Test] [Test]
public void DivByZero() public void DivByZero()
{ {
var ex = Assert.Throws<RpcException>(() => client.Div(new DivArgs.Builder { Dividend = 0, Divisor = 0 }.Build())); var ex = Assert.Throws<RpcException>(() => client.Div(new DivArgs { Dividend = 0, Divisor = 0 }));
Assert.AreEqual(StatusCode.Unknown, ex.Status.StatusCode); Assert.AreEqual(StatusCode.Unknown, ex.Status.StatusCode);
} }
[Test] [Test]
public async Task DivAsync() public async Task DivAsync()
{ {
DivReply response = await client.DivAsync(new DivArgs.Builder { Dividend = 10, Divisor = 3 }.Build()); DivReply response = await client.DivAsync(new DivArgs { Dividend = 10, Divisor = 3 });
Assert.AreEqual(3, response.Quotient); Assert.AreEqual(3, response.Quotient);
Assert.AreEqual(1, response.Remainder); Assert.AreEqual(1, response.Remainder);
} }
@ -106,7 +106,7 @@ namespace math.Tests
[Test] [Test]
public async Task Fib() public async Task Fib()
{ {
using (var call = client.Fib(new FibArgs.Builder { Limit = 6 }.Build())) using (var call = client.Fib(new FibArgs { Limit = 6 }))
{ {
var responses = await call.ResponseStream.ToListAsync(); var responses = await call.ResponseStream.ToListAsync();
CollectionAssert.AreEqual(new List<long> { 1, 1, 2, 3, 5, 8 }, CollectionAssert.AreEqual(new List<long> { 1, 1, 2, 3, 5, 8 },
@ -119,8 +119,7 @@ namespace math.Tests
{ {
var cts = new CancellationTokenSource(); var cts = new CancellationTokenSource();
using (var call = client.Fib(new FibArgs.Builder { Limit = 0 }.Build(), using (var call = client.Fib(new FibArgs { Limit = 0 }, cancellationToken: cts.Token))
cancellationToken: cts.Token))
{ {
List<long> responses = new List<long>(); List<long> responses = new List<long>();
@ -147,7 +146,7 @@ namespace math.Tests
[Test] [Test]
public async Task FibWithDeadline() public async Task FibWithDeadline()
{ {
using (var call = client.Fib(new FibArgs.Builder { Limit = 0 }.Build(), using (var call = client.Fib(new FibArgs { Limit = 0 },
deadline: DateTime.UtcNow.AddMilliseconds(500))) deadline: DateTime.UtcNow.AddMilliseconds(500)))
{ {
var ex = Assert.Throws<RpcException>(async () => await call.ResponseStream.ToListAsync()); var ex = Assert.Throws<RpcException>(async () => await call.ResponseStream.ToListAsync());
@ -163,8 +162,7 @@ namespace math.Tests
{ {
using (var call = client.Sum()) using (var call = client.Sum())
{ {
var numbers = new List<long> { 10, 20, 30 }.ConvertAll( var numbers = new List<long> { 10, 20, 30 }.ConvertAll(n => new Num{ Num_ = n });
n => Num.CreateBuilder().SetNum_(n).Build());
await call.RequestStream.WriteAllAsync(numbers); await call.RequestStream.WriteAllAsync(numbers);
var result = await call.ResponseAsync; var result = await call.ResponseAsync;
@ -177,9 +175,9 @@ namespace math.Tests
{ {
var divArgsList = new List<DivArgs> var divArgsList = new List<DivArgs>
{ {
new DivArgs.Builder { Dividend = 10, Divisor = 3 }.Build(), new DivArgs { Dividend = 10, Divisor = 3 },
new DivArgs.Builder { Dividend = 100, Divisor = 21 }.Build(), new DivArgs { Dividend = 100, Divisor = 21 },
new DivArgs.Builder { Dividend = 7, Divisor = 2 }.Build() new DivArgs { Dividend = 7, Divisor = 2 }
}; };
using (var call = client.DivMany()) using (var call = client.DivMany())

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<packages> <packages>
<package id="Google.ProtocolBuffers" version="2.4.1.521" targetFramework="net45" /> <package id="Google.Protobuf" version="3.0.0-alpha4" targetFramework="net45" />
<package id="Ix-Async" version="1.2.3" targetFramework="net45" /> <package id="Ix-Async" version="1.2.3" targetFramework="net45" />
<package id="NUnit" version="2.6.4" targetFramework="net45" /> <package id="NUnit" version="2.6.4" targetFramework="net45" />
</packages> </packages>

@ -37,11 +37,12 @@
<AssemblyOriginatorKeyFile>C:\keys\Grpc.snk</AssemblyOriginatorKeyFile> <AssemblyOriginatorKeyFile>C:\keys\Grpc.snk</AssemblyOriginatorKeyFile>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="Google.Protobuf, Version=3.0.0.0, Culture=neutral, PublicKeyToken=a7d26565bac4d604, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\Google.Protobuf.3.0.0-alpha4\lib\portable-net45+netcore45+wpa81+wp8\Google.Protobuf.dll</HintPath>
</Reference>
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="System.Data.Linq" /> <Reference Include="System.Data.Linq" />
<Reference Include="Google.ProtocolBuffers">
<HintPath>..\packages\Google.ProtocolBuffers.2.4.1.521\lib\net40\Google.ProtocolBuffers.dll</HintPath>
</Reference>
<Reference Include="System.Interactive.Async"> <Reference Include="System.Interactive.Async">
<HintPath>..\packages\Ix-Async.1.2.3\lib\net45\System.Interactive.Async.dll</HintPath> <HintPath>..\packages\Ix-Async.1.2.3\lib\net45\System.Interactive.Async.dll</HintPath>
</Reference> </Reference>

File diff suppressed because it is too large Load Diff

@ -34,25 +34,25 @@ using System.Collections.Generic;
using System.Threading.Tasks; using System.Threading.Tasks;
using Grpc.Core.Utils; using Grpc.Core.Utils;
namespace math namespace Math
{ {
public static class MathExamples public static class MathExamples
{ {
public static void DivExample(Math.IMathClient client) public static void DivExample(Math.IMathClient client)
{ {
DivReply result = client.Div(new DivArgs.Builder { Dividend = 10, Divisor = 3 }.Build()); DivReply result = client.Div(new DivArgs { Dividend = 10, Divisor = 3 });
Console.WriteLine("Div Result: " + result); Console.WriteLine("Div Result: " + result);
} }
public static async Task DivAsyncExample(Math.IMathClient client) public static async Task DivAsyncExample(Math.IMathClient client)
{ {
DivReply result = await client.DivAsync(new DivArgs.Builder { Dividend = 4, Divisor = 5 }.Build()); DivReply result = await client.DivAsync(new DivArgs { Dividend = 4, Divisor = 5 });
Console.WriteLine("DivAsync Result: " + result); Console.WriteLine("DivAsync Result: " + result);
} }
public static async Task FibExample(Math.IMathClient client) public static async Task FibExample(Math.IMathClient client)
{ {
using (var call = client.Fib(new FibArgs.Builder { Limit = 5 }.Build())) using (var call = client.Fib(new FibArgs { Limit = 5 }))
{ {
List<Num> result = await call.ResponseStream.ToListAsync(); List<Num> result = await call.ResponseStream.ToListAsync();
Console.WriteLine("Fib Result: " + string.Join("|", result)); Console.WriteLine("Fib Result: " + string.Join("|", result));
@ -63,9 +63,9 @@ namespace math
{ {
var numbers = new List<Num> var numbers = new List<Num>
{ {
new Num.Builder { Num_ = 1 }.Build(), new Num { Num_ = 1 },
new Num.Builder { Num_ = 2 }.Build(), new Num { Num_ = 2 },
new Num.Builder { Num_ = 3 }.Build() new Num { Num_ = 3 }
}; };
using (var call = client.Sum()) using (var call = client.Sum())
@ -79,9 +79,9 @@ namespace math
{ {
var divArgsList = new List<DivArgs> var divArgsList = new List<DivArgs>
{ {
new DivArgs.Builder { Dividend = 10, Divisor = 3 }.Build(), new DivArgs { Dividend = 10, Divisor = 3 },
new DivArgs.Builder { Dividend = 100, Divisor = 21 }.Build(), new DivArgs { Dividend = 100, Divisor = 21 },
new DivArgs.Builder { Dividend = 7, Divisor = 2 }.Build() new DivArgs { Dividend = 7, Divisor = 2 }
}; };
using (var call = client.DivMany()) using (var call = client.DivMany())
{ {
@ -94,9 +94,9 @@ namespace math
{ {
var numbers = new List<Num> var numbers = new List<Num>
{ {
new Num.Builder { Num_ = 1 }.Build(), new Num { Num_ = 1 },
new Num.Builder { Num_ = 2 }.Build(), new Num { Num_ = 2 },
new Num.Builder { Num_ = 3 }.Build() new Num { Num_ = 3 }
}; };
Num sum; Num sum;
@ -106,7 +106,7 @@ namespace math
sum = await sumCall.ResponseAsync; sum = await sumCall.ResponseAsync;
} }
DivReply result = await client.DivAsync(new DivArgs.Builder { Dividend = sum.Num_, Divisor = numbers.Count }.Build()); DivReply result = await client.DivAsync(new DivArgs { Dividend = sum.Num_, Divisor = numbers.Count });
Console.WriteLine("Avg Result: " + result); Console.WriteLine("Avg Result: " + result);
} }
} }

@ -7,66 +7,72 @@ using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
using Grpc.Core; using Grpc.Core;
namespace math { namespace Math {
public static class Math public static class Math
{ {
static readonly string __ServiceName = "math.Math"; static readonly string __ServiceName = "math.Math";
static readonly Marshaller<global::math.DivArgs> __Marshaller_DivArgs = Marshallers.Create((arg) => arg.ToByteArray(), global::math.DivArgs.ParseFrom); static readonly Marshaller<global::Math.DivArgs> __Marshaller_DivArgs = Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Math.DivArgs.Parser.ParseFrom);
static readonly Marshaller<global::math.DivReply> __Marshaller_DivReply = Marshallers.Create((arg) => arg.ToByteArray(), global::math.DivReply.ParseFrom); static readonly Marshaller<global::Math.DivReply> __Marshaller_DivReply = Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Math.DivReply.Parser.ParseFrom);
static readonly Marshaller<global::math.FibArgs> __Marshaller_FibArgs = Marshallers.Create((arg) => arg.ToByteArray(), global::math.FibArgs.ParseFrom); static readonly Marshaller<global::Math.FibArgs> __Marshaller_FibArgs = Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Math.FibArgs.Parser.ParseFrom);
static readonly Marshaller<global::math.Num> __Marshaller_Num = Marshallers.Create((arg) => arg.ToByteArray(), global::math.Num.ParseFrom); static readonly Marshaller<global::Math.Num> __Marshaller_Num = Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Math.Num.Parser.ParseFrom);
static readonly Method<global::math.DivArgs, global::math.DivReply> __Method_Div = new Method<global::math.DivArgs, global::math.DivReply>( static readonly Method<global::Math.DivArgs, global::Math.DivReply> __Method_Div = new Method<global::Math.DivArgs, global::Math.DivReply>(
MethodType.Unary, MethodType.Unary,
__ServiceName, __ServiceName,
"Div", "Div",
__Marshaller_DivArgs, __Marshaller_DivArgs,
__Marshaller_DivReply); __Marshaller_DivReply);
static readonly Method<global::math.DivArgs, global::math.DivReply> __Method_DivMany = new Method<global::math.DivArgs, global::math.DivReply>( static readonly Method<global::Math.DivArgs, global::Math.DivReply> __Method_DivMany = new Method<global::Math.DivArgs, global::Math.DivReply>(
MethodType.DuplexStreaming, MethodType.DuplexStreaming,
__ServiceName, __ServiceName,
"DivMany", "DivMany",
__Marshaller_DivArgs, __Marshaller_DivArgs,
__Marshaller_DivReply); __Marshaller_DivReply);
static readonly Method<global::math.FibArgs, global::math.Num> __Method_Fib = new Method<global::math.FibArgs, global::math.Num>( static readonly Method<global::Math.FibArgs, global::Math.Num> __Method_Fib = new Method<global::Math.FibArgs, global::Math.Num>(
MethodType.ServerStreaming, MethodType.ServerStreaming,
__ServiceName, __ServiceName,
"Fib", "Fib",
__Marshaller_FibArgs, __Marshaller_FibArgs,
__Marshaller_Num); __Marshaller_Num);
static readonly Method<global::math.Num, global::math.Num> __Method_Sum = new Method<global::math.Num, global::math.Num>( static readonly Method<global::Math.Num, global::Math.Num> __Method_Sum = new Method<global::Math.Num, global::Math.Num>(
MethodType.ClientStreaming, MethodType.ClientStreaming,
__ServiceName, __ServiceName,
"Sum", "Sum",
__Marshaller_Num, __Marshaller_Num,
__Marshaller_Num); __Marshaller_Num);
// service descriptor
public static global::Google.Protobuf.Reflection.ServiceDescriptor Descriptor
{
get { return global::Math.Proto.Math.Descriptor.Services[0]; }
}
// client interface // client interface
public interface IMathClient public interface IMathClient
{ {
global::math.DivReply Div(global::math.DivArgs request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)); global::Math.DivReply Div(global::Math.DivArgs request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken));
global::math.DivReply Div(global::math.DivArgs request, CallOptions options); global::Math.DivReply Div(global::Math.DivArgs request, CallOptions options);
AsyncUnaryCall<global::math.DivReply> DivAsync(global::math.DivArgs request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)); AsyncUnaryCall<global::Math.DivReply> DivAsync(global::Math.DivArgs request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken));
AsyncUnaryCall<global::math.DivReply> DivAsync(global::math.DivArgs request, CallOptions options); AsyncUnaryCall<global::Math.DivReply> DivAsync(global::Math.DivArgs request, CallOptions options);
AsyncDuplexStreamingCall<global::math.DivArgs, global::math.DivReply> DivMany(Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)); AsyncDuplexStreamingCall<global::Math.DivArgs, global::Math.DivReply> DivMany(Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken));
AsyncDuplexStreamingCall<global::math.DivArgs, global::math.DivReply> DivMany(CallOptions options); AsyncDuplexStreamingCall<global::Math.DivArgs, global::Math.DivReply> DivMany(CallOptions options);
AsyncServerStreamingCall<global::math.Num> Fib(global::math.FibArgs request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)); AsyncServerStreamingCall<global::Math.Num> Fib(global::Math.FibArgs request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken));
AsyncServerStreamingCall<global::math.Num> Fib(global::math.FibArgs request, CallOptions options); AsyncServerStreamingCall<global::Math.Num> Fib(global::Math.FibArgs request, CallOptions options);
AsyncClientStreamingCall<global::math.Num, global::math.Num> Sum(Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)); AsyncClientStreamingCall<global::Math.Num, global::Math.Num> Sum(Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken));
AsyncClientStreamingCall<global::math.Num, global::math.Num> Sum(CallOptions options); AsyncClientStreamingCall<global::Math.Num, global::Math.Num> Sum(CallOptions options);
} }
// server-side interface // server-side interface
public interface IMath public interface IMath
{ {
Task<global::math.DivReply> Div(global::math.DivArgs request, ServerCallContext context); Task<global::Math.DivReply> Div(global::Math.DivArgs request, ServerCallContext context);
Task DivMany(IAsyncStreamReader<global::math.DivArgs> requestStream, IServerStreamWriter<global::math.DivReply> responseStream, ServerCallContext context); Task DivMany(IAsyncStreamReader<global::Math.DivArgs> requestStream, IServerStreamWriter<global::Math.DivReply> responseStream, ServerCallContext context);
Task Fib(global::math.FibArgs request, IServerStreamWriter<global::math.Num> responseStream, ServerCallContext context); Task Fib(global::Math.FibArgs request, IServerStreamWriter<global::Math.Num> responseStream, ServerCallContext context);
Task<global::math.Num> Sum(IAsyncStreamReader<global::math.Num> requestStream, ServerCallContext context); Task<global::Math.Num> Sum(IAsyncStreamReader<global::Math.Num> requestStream, ServerCallContext context);
} }
// client stub // client stub
@ -75,52 +81,52 @@ namespace math {
public MathClient(Channel channel) : base(channel) public MathClient(Channel channel) : base(channel)
{ {
} }
public global::math.DivReply Div(global::math.DivArgs request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) public global::Math.DivReply Div(global::Math.DivArgs request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken))
{ {
var call = CreateCall(__Method_Div, new CallOptions(headers, deadline, cancellationToken)); var call = CreateCall(__Method_Div, new CallOptions(headers, deadline, cancellationToken));
return Calls.BlockingUnaryCall(call, request); return Calls.BlockingUnaryCall(call, request);
} }
public global::math.DivReply Div(global::math.DivArgs request, CallOptions options) public global::Math.DivReply Div(global::Math.DivArgs request, CallOptions options)
{ {
var call = CreateCall(__Method_Div, options); var call = CreateCall(__Method_Div, options);
return Calls.BlockingUnaryCall(call, request); return Calls.BlockingUnaryCall(call, request);
} }
public AsyncUnaryCall<global::math.DivReply> DivAsync(global::math.DivArgs request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) public AsyncUnaryCall<global::Math.DivReply> DivAsync(global::Math.DivArgs request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken))
{ {
var call = CreateCall(__Method_Div, new CallOptions(headers, deadline, cancellationToken)); var call = CreateCall(__Method_Div, new CallOptions(headers, deadline, cancellationToken));
return Calls.AsyncUnaryCall(call, request); return Calls.AsyncUnaryCall(call, request);
} }
public AsyncUnaryCall<global::math.DivReply> DivAsync(global::math.DivArgs request, CallOptions options) public AsyncUnaryCall<global::Math.DivReply> DivAsync(global::Math.DivArgs request, CallOptions options)
{ {
var call = CreateCall(__Method_Div, options); var call = CreateCall(__Method_Div, options);
return Calls.AsyncUnaryCall(call, request); return Calls.AsyncUnaryCall(call, request);
} }
public AsyncDuplexStreamingCall<global::math.DivArgs, global::math.DivReply> DivMany(Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) public AsyncDuplexStreamingCall<global::Math.DivArgs, global::Math.DivReply> DivMany(Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken))
{ {
var call = CreateCall(__Method_DivMany, new CallOptions(headers, deadline, cancellationToken)); var call = CreateCall(__Method_DivMany, new CallOptions(headers, deadline, cancellationToken));
return Calls.AsyncDuplexStreamingCall(call); return Calls.AsyncDuplexStreamingCall(call);
} }
public AsyncDuplexStreamingCall<global::math.DivArgs, global::math.DivReply> DivMany(CallOptions options) public AsyncDuplexStreamingCall<global::Math.DivArgs, global::Math.DivReply> DivMany(CallOptions options)
{ {
var call = CreateCall(__Method_DivMany, options); var call = CreateCall(__Method_DivMany, options);
return Calls.AsyncDuplexStreamingCall(call); return Calls.AsyncDuplexStreamingCall(call);
} }
public AsyncServerStreamingCall<global::math.Num> Fib(global::math.FibArgs request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) public AsyncServerStreamingCall<global::Math.Num> Fib(global::Math.FibArgs request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken))
{ {
var call = CreateCall(__Method_Fib, new CallOptions(headers, deadline, cancellationToken)); var call = CreateCall(__Method_Fib, new CallOptions(headers, deadline, cancellationToken));
return Calls.AsyncServerStreamingCall(call, request); return Calls.AsyncServerStreamingCall(call, request);
} }
public AsyncServerStreamingCall<global::math.Num> Fib(global::math.FibArgs request, CallOptions options) public AsyncServerStreamingCall<global::Math.Num> Fib(global::Math.FibArgs request, CallOptions options)
{ {
var call = CreateCall(__Method_Fib, options); var call = CreateCall(__Method_Fib, options);
return Calls.AsyncServerStreamingCall(call, request); return Calls.AsyncServerStreamingCall(call, request);
} }
public AsyncClientStreamingCall<global::math.Num, global::math.Num> Sum(Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) public AsyncClientStreamingCall<global::Math.Num, global::Math.Num> Sum(Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken))
{ {
var call = CreateCall(__Method_Sum, new CallOptions(headers, deadline, cancellationToken)); var call = CreateCall(__Method_Sum, new CallOptions(headers, deadline, cancellationToken));
return Calls.AsyncClientStreamingCall(call); return Calls.AsyncClientStreamingCall(call);
} }
public AsyncClientStreamingCall<global::math.Num, global::math.Num> Sum(CallOptions options) public AsyncClientStreamingCall<global::Math.Num, global::Math.Num> Sum(CallOptions options)
{ {
var call = CreateCall(__Method_Sum, options); var call = CreateCall(__Method_Sum, options);
return Calls.AsyncClientStreamingCall(call); return Calls.AsyncClientStreamingCall(call);

@ -38,7 +38,7 @@ using System.Threading.Tasks;
using Grpc.Core; using Grpc.Core;
using Grpc.Core.Utils; using Grpc.Core.Utils;
namespace math namespace Math
{ {
/// <summary> /// <summary>
/// Implementation of MathService server /// Implementation of MathService server
@ -79,7 +79,7 @@ namespace math
{ {
sum += num.Num_; sum += num.Num_;
}); });
return Num.CreateBuilder().SetNum_(sum).Build(); return new Num { Num_ = sum };
} }
public async Task DivMany(IAsyncStreamReader<DivArgs> requestStream, IServerStreamWriter<DivReply> responseStream, ServerCallContext context) public async Task DivMany(IAsyncStreamReader<DivArgs> requestStream, IServerStreamWriter<DivReply> responseStream, ServerCallContext context)
@ -91,13 +91,13 @@ namespace math
{ {
long quotient = args.Dividend / args.Divisor; long quotient = args.Dividend / args.Divisor;
long remainder = args.Dividend % args.Divisor; long remainder = args.Dividend % args.Divisor;
return new DivReply.Builder { Quotient = quotient, Remainder = remainder }.Build(); return new DivReply { Quotient = quotient, Remainder = remainder };
} }
static IEnumerable<Num> FibInternal(long n) static IEnumerable<Num> FibInternal(long n)
{ {
long a = 1; long a = 1;
yield return new Num.Builder { Num_ = a }.Build(); yield return new Num { Num_ = a };
long b = 1; long b = 1;
for (long i = 0; i < n - 1; i++) for (long i = 0; i < n - 1; i++)
@ -105,7 +105,7 @@ namespace math
long temp = a; long temp = a;
a = b; a = b;
b = temp + b; b = temp + b;
yield return new Num.Builder { Num_ = a }.Build(); yield return new Num { Num_ = a };
} }
} }
} }

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<packages> <packages>
<package id="Google.ProtocolBuffers" version="2.4.1.521" targetFramework="net45" /> <package id="Google.Protobuf" version="3.0.0-alpha4" targetFramework="net45" />
<package id="Ix-Async" version="1.2.3" targetFramework="net45" /> <package id="Ix-Async" version="1.2.3" targetFramework="net45" />
<package id="NUnit" version="2.6.4" targetFramework="net45" /> <package id="NUnit" version="2.6.4" targetFramework="net45" />
</packages> </packages>

@ -28,30 +28,30 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
syntax = "proto2"; syntax = "proto3";
package math; package math;
message DivArgs { message DivArgs {
optional int64 dividend = 1; int64 dividend = 1;
optional int64 divisor = 2; int64 divisor = 2;
} }
message DivReply { message DivReply {
optional int64 quotient = 1; int64 quotient = 1;
optional int64 remainder = 2; int64 remainder = 2;
} }
message FibArgs { message FibArgs {
optional int64 limit = 1; int64 limit = 1;
} }
message Num { message Num {
optional int64 num = 1; int64 num = 1;
} }
message FibReply { message FibReply {
optional int64 count = 1; int64 count = 1;
} }
service Math { service Math {

@ -37,11 +37,9 @@
<AssemblyOriginatorKeyFile>C:\keys\Grpc.snk</AssemblyOriginatorKeyFile> <AssemblyOriginatorKeyFile>C:\keys\Grpc.snk</AssemblyOriginatorKeyFile>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="Google.ProtocolBuffers"> <Reference Include="Google.Protobuf, Version=3.0.0.0, Culture=neutral, PublicKeyToken=a7d26565bac4d604, processorArchitecture=MSIL">
<HintPath>..\packages\Google.ProtocolBuffers.2.4.1.555\lib\net40\Google.ProtocolBuffers.dll</HintPath> <SpecificVersion>False</SpecificVersion>
</Reference> <HintPath>..\packages\Google.Protobuf.3.0.0-alpha4\lib\portable-net45+netcore45+wpa81+wp8\Google.Protobuf.dll</HintPath>
<Reference Include="Google.ProtocolBuffers.Serialization">
<HintPath>..\packages\Google.ProtocolBuffers.2.4.1.555\lib\net40\Google.ProtocolBuffers.Serialization.dll</HintPath>
</Reference> </Reference>
<Reference Include="nunit.framework"> <Reference Include="nunit.framework">
<HintPath>..\packages\NUnit.2.6.4\lib\nunit.framework.dll</HintPath> <HintPath>..\packages\NUnit.2.6.4\lib\nunit.framework.dll</HintPath>

@ -81,14 +81,14 @@ namespace Grpc.HealthCheck.Tests
{ {
serviceImpl.SetStatus("", "", HealthCheckResponse.Types.ServingStatus.SERVING); serviceImpl.SetStatus("", "", HealthCheckResponse.Types.ServingStatus.SERVING);
var response = client.Check(HealthCheckRequest.CreateBuilder().SetHost("").SetService("").Build()); var response = client.Check(new HealthCheckRequest { Host = "", Service = "" });
Assert.AreEqual(HealthCheckResponse.Types.ServingStatus.SERVING, response.Status); Assert.AreEqual(HealthCheckResponse.Types.ServingStatus.SERVING, response.Status);
} }
[Test] [Test]
public void ServiceDoesntExist() public void ServiceDoesntExist()
{ {
Assert.Throws(Is.TypeOf(typeof(RpcException)).And.Property("Status").Property("StatusCode").EqualTo(StatusCode.NotFound), () => client.Check(HealthCheckRequest.CreateBuilder().SetHost("").SetService("nonexistent.service").Build())); Assert.Throws(Is.TypeOf(typeof(RpcException)).And.Property("Status").Property("StatusCode").EqualTo(StatusCode.NotFound), () => client.Check(new HealthCheckRequest{ Host = "", Service = "nonexistent.service" }));
} }
// TODO(jtattermusch): add test with timeout once timeouts are supported // TODO(jtattermusch): add test with timeout once timeouts are supported

@ -101,7 +101,7 @@ namespace Grpc.HealthCheck.Tests
private static HealthCheckResponse.Types.ServingStatus GetStatusHelper(HealthServiceImpl impl, string host, string service) private static HealthCheckResponse.Types.ServingStatus GetStatusHelper(HealthServiceImpl impl, string host, string service)
{ {
return impl.Check(HealthCheckRequest.CreateBuilder().SetHost(host).SetService(service).Build(), null).Result.Status; return impl.Check(new HealthCheckRequest{ Host = host, Service = service}, null).Result.Status;
} }
} }
} }

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<packages> <packages>
<package id="Google.ProtocolBuffers" version="2.4.1.555" targetFramework="net45" /> <package id="Google.Protobuf" version="3.0.0-alpha4" targetFramework="net45" />
<package id="NUnit" version="2.6.4" targetFramework="net45" /> <package id="NUnit" version="2.6.4" targetFramework="net45" />
</packages> </packages>

@ -38,11 +38,9 @@
<AssemblyOriginatorKeyFile>C:\keys\Grpc.snk</AssemblyOriginatorKeyFile> <AssemblyOriginatorKeyFile>C:\keys\Grpc.snk</AssemblyOriginatorKeyFile>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="Google.ProtocolBuffers"> <Reference Include="Google.Protobuf, Version=3.0.0.0, Culture=neutral, PublicKeyToken=a7d26565bac4d604, processorArchitecture=MSIL">
<HintPath>..\packages\Google.ProtocolBuffers.2.4.1.555\lib\net40\Google.ProtocolBuffers.dll</HintPath> <SpecificVersion>False</SpecificVersion>
</Reference> <HintPath>..\packages\Google.Protobuf.3.0.0-alpha4\lib\portable-net45+netcore45+wpa81+wp8\Google.Protobuf.dll</HintPath>
<Reference Include="Google.ProtocolBuffers.Serialization">
<HintPath>..\packages\Google.ProtocolBuffers.2.4.1.555\lib\net40\Google.ProtocolBuffers.Serialization.dll</HintPath>
</Reference> </Reference>
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="System.Core" /> <Reference Include="System.Core" />

@ -14,7 +14,7 @@
<copyright>Copyright 2015, Google Inc.</copyright> <copyright>Copyright 2015, Google Inc.</copyright>
<tags>gRPC health check</tags> <tags>gRPC health check</tags>
<dependencies> <dependencies>
<dependency id="Google.ProtocolBuffers" version="2.4.1.555" /> <dependency id="Google.Protobuf" version="$ProtobufVersion$" />
<dependency id="Grpc.Core" version="$version$" /> <dependency id="Grpc.Core" version="$version$" />
<dependency id="Ix-Async" version="1.2.3" /> <dependency id="Ix-Async" version="1.2.3" />
</dependencies> </dependencies>

@ -3,9 +3,9 @@
#pragma warning disable 1591, 0612, 3021 #pragma warning disable 1591, 0612, 3021
#region Designer generated code #region Designer generated code
using pb = global::Google.ProtocolBuffers; using pb = global::Google.Protobuf;
using pbc = global::Google.ProtocolBuffers.Collections; using pbc = global::Google.Protobuf.Collections;
using pbd = global::Google.ProtocolBuffers.Descriptors; using pbr = global::Google.Protobuf.Reflection;
using scg = global::System.Collections.Generic; using scg = global::System.Collections.Generic;
namespace Grpc.Health.V1Alpha { namespace Grpc.Health.V1Alpha {
@ -14,21 +14,11 @@ namespace Grpc.Health.V1Alpha {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
public static partial class Health { public static partial class Health {
#region Extension registration
public static void RegisterAllExtensions(pb::ExtensionRegistry registry) {
}
#endregion
#region Static variables
internal static pbd::MessageDescriptor internal__static_grpc_health_v1alpha_HealthCheckRequest__Descriptor;
internal static pb::FieldAccess.FieldAccessorTable<global::Grpc.Health.V1Alpha.HealthCheckRequest, global::Grpc.Health.V1Alpha.HealthCheckRequest.Builder> internal__static_grpc_health_v1alpha_HealthCheckRequest__FieldAccessorTable;
internal static pbd::MessageDescriptor internal__static_grpc_health_v1alpha_HealthCheckResponse__Descriptor;
internal static pb::FieldAccess.FieldAccessorTable<global::Grpc.Health.V1Alpha.HealthCheckResponse, global::Grpc.Health.V1Alpha.HealthCheckResponse.Builder> internal__static_grpc_health_v1alpha_HealthCheckResponse__FieldAccessorTable;
#endregion
#region Descriptor #region Descriptor
public static pbd::FileDescriptor Descriptor { public static pbr::FileDescriptor Descriptor {
get { return descriptor; } get { return descriptor; }
} }
private static pbd::FileDescriptor descriptor; private static pbr::FileDescriptor descriptor;
static Health() { static Health() {
byte[] descriptorData = global::System.Convert.FromBase64String( byte[] descriptorData = global::System.Convert.FromBase64String(
@ -41,24 +31,13 @@ namespace Grpc.Health.V1Alpha {
"EAESDwoLTk9UX1NFUlZJTkcQAjJkCgZIZWFsdGgSWgoFQ2hlY2sSJy5ncnBj", "EAESDwoLTk9UX1NFUlZJTkcQAjJkCgZIZWFsdGgSWgoFQ2hlY2sSJy5ncnBj",
"LmhlYWx0aC52MWFscGhhLkhlYWx0aENoZWNrUmVxdWVzdBooLmdycGMuaGVh", "LmhlYWx0aC52MWFscGhhLkhlYWx0aENoZWNrUmVxdWVzdBooLmdycGMuaGVh",
"bHRoLnYxYWxwaGEuSGVhbHRoQ2hlY2tSZXNwb25zZUIWqgITR3JwYy5IZWFs", "bHRoLnYxYWxwaGEuSGVhbHRoQ2hlY2tSZXNwb25zZUIWqgITR3JwYy5IZWFs",
"dGguVjFBbHBoYQ==")); "dGguVjFBbHBoYWIGcHJvdG8z"));
pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) { descriptor = pbr::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData,
descriptor = root; new pbr::FileDescriptor[] { },
internal__static_grpc_health_v1alpha_HealthCheckRequest__Descriptor = Descriptor.MessageTypes[0]; new pbr::GeneratedCodeInfo(null, new pbr::GeneratedCodeInfo[] {
internal__static_grpc_health_v1alpha_HealthCheckRequest__FieldAccessorTable = new pbr::GeneratedCodeInfo(typeof(global::Grpc.Health.V1Alpha.HealthCheckRequest), new[]{ "Host", "Service" }, null, null, null),
new pb::FieldAccess.FieldAccessorTable<global::Grpc.Health.V1Alpha.HealthCheckRequest, global::Grpc.Health.V1Alpha.HealthCheckRequest.Builder>(internal__static_grpc_health_v1alpha_HealthCheckRequest__Descriptor, new pbr::GeneratedCodeInfo(typeof(global::Grpc.Health.V1Alpha.HealthCheckResponse), new[]{ "Status" }, null, new[]{ typeof(global::Grpc.Health.V1Alpha.HealthCheckResponse.Types.ServingStatus) }, null)
new string[] { "Host", "Service", }); }));
internal__static_grpc_health_v1alpha_HealthCheckResponse__Descriptor = Descriptor.MessageTypes[1];
internal__static_grpc_health_v1alpha_HealthCheckResponse__FieldAccessorTable =
new pb::FieldAccess.FieldAccessorTable<global::Grpc.Health.V1Alpha.HealthCheckResponse, global::Grpc.Health.V1Alpha.HealthCheckResponse.Builder>(internal__static_grpc_health_v1alpha_HealthCheckResponse__Descriptor,
new string[] { "Status", });
pb::ExtensionRegistry registry = pb::ExtensionRegistry.CreateInstance();
RegisterAllExtensions(registry);
return registry;
};
pbd::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData,
new pbd::FileDescriptor[] {
}, assigner);
} }
#endregion #endregion
@ -66,618 +45,245 @@ namespace Grpc.Health.V1Alpha {
} }
#region Messages #region Messages
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
public sealed partial class HealthCheckRequest : pb::GeneratedMessage<HealthCheckRequest, HealthCheckRequest.Builder> { public sealed partial class HealthCheckRequest : pb::IMessage<HealthCheckRequest> {
private HealthCheckRequest() { } private static readonly pb::MessageParser<HealthCheckRequest> _parser = new pb::MessageParser<HealthCheckRequest>(() => new HealthCheckRequest());
private static readonly HealthCheckRequest defaultInstance = new HealthCheckRequest().MakeReadOnly(); public static pb::MessageParser<HealthCheckRequest> Parser { get { return _parser; } }
private static readonly string[] _healthCheckRequestFieldNames = new string[] { "host", "service" };
private static readonly uint[] _healthCheckRequestFieldTags = new uint[] { 10, 18 }; public static pbr::MessageDescriptor Descriptor {
public static HealthCheckRequest DefaultInstance { get { return global::Grpc.Health.V1Alpha.Proto.Health.Descriptor.MessageTypes[0]; }
get { return defaultInstance; }
} }
public override HealthCheckRequest DefaultInstanceForType { pbr::MessageDescriptor pb::IMessage.Descriptor {
get { return DefaultInstance; } get { return Descriptor; }
} }
protected override HealthCheckRequest ThisMessage { public HealthCheckRequest() {
get { return this; } OnConstruction();
} }
public static pbd::MessageDescriptor Descriptor { partial void OnConstruction();
get { return global::Grpc.Health.V1Alpha.Proto.Health.internal__static_grpc_health_v1alpha_HealthCheckRequest__Descriptor; }
public HealthCheckRequest(HealthCheckRequest other) : this() {
host_ = other.host_;
service_ = other.service_;
} }
protected override pb::FieldAccess.FieldAccessorTable<HealthCheckRequest, HealthCheckRequest.Builder> InternalFieldAccessors { public HealthCheckRequest Clone() {
get { return global::Grpc.Health.V1Alpha.Proto.Health.internal__static_grpc_health_v1alpha_HealthCheckRequest__FieldAccessorTable; } return new HealthCheckRequest(this);
} }
public const int HostFieldNumber = 1; public const int HostFieldNumber = 1;
private bool hasHost;
private string host_ = ""; private string host_ = "";
public bool HasHost {
get { return hasHost; }
}
public string Host { public string Host {
get { return host_; } get { return host_; }
set {
host_ = pb::Preconditions.CheckNotNull(value, "value");
}
} }
public const int ServiceFieldNumber = 2; public const int ServiceFieldNumber = 2;
private bool hasService;
private string service_ = ""; private string service_ = "";
public bool HasService {
get { return hasService; }
}
public string Service { public string Service {
get { return service_; } get { return service_; }
} set {
service_ = pb::Preconditions.CheckNotNull(value, "value");
public override bool IsInitialized {
get {
return true;
}
}
public override void WriteTo(pb::ICodedOutputStream output) {
CalcSerializedSize();
string[] field_names = _healthCheckRequestFieldNames;
if (hasHost) {
output.WriteString(1, field_names[0], Host);
}
if (hasService) {
output.WriteString(2, field_names[1], Service);
} }
UnknownFields.WriteTo(output);
} }
private int memoizedSerializedSize = -1; public override bool Equals(object other) {
public override int SerializedSize { return Equals(other as HealthCheckRequest);
get {
int size = memoizedSerializedSize;
if (size != -1) return size;
return CalcSerializedSize();
}
} }
private int CalcSerializedSize() { public bool Equals(HealthCheckRequest other) {
int size = memoizedSerializedSize; if (ReferenceEquals(other, null)) {
if (size != -1) return size; return false;
size = 0;
if (hasHost) {
size += pb::CodedOutputStream.ComputeStringSize(1, Host);
} }
if (hasService) { if (ReferenceEquals(other, this)) {
size += pb::CodedOutputStream.ComputeStringSize(2, Service); return true;
} }
size += UnknownFields.SerializedSize; if (Host != other.Host) return false;
memoizedSerializedSize = size; if (Service != other.Service) return false;
return size; return true;
}
public static HealthCheckRequest ParseFrom(pb::ByteString data) {
return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed();
}
public static HealthCheckRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) {
return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed();
}
public static HealthCheckRequest ParseFrom(byte[] data) {
return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed();
}
public static HealthCheckRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) {
return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed();
}
public static HealthCheckRequest ParseFrom(global::System.IO.Stream input) {
return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
}
public static HealthCheckRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed();
}
public static HealthCheckRequest ParseDelimitedFrom(global::System.IO.Stream input) {
return CreateBuilder().MergeDelimitedFrom(input).BuildParsed();
}
public static HealthCheckRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed();
}
public static HealthCheckRequest ParseFrom(pb::ICodedInputStream input) {
return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
}
public static HealthCheckRequest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed();
}
private HealthCheckRequest MakeReadOnly() {
return this;
} }
public static Builder CreateBuilder() { return new Builder(); } public override int GetHashCode() {
public override Builder ToBuilder() { return CreateBuilder(this); } int hash = 1;
public override Builder CreateBuilderForType() { return new Builder(); } if (Host.Length != 0) hash ^= Host.GetHashCode();
public static Builder CreateBuilder(HealthCheckRequest prototype) { if (Service.Length != 0) hash ^= Service.GetHashCode();
return new Builder(prototype); return hash;
} }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public override string ToString() {
public sealed partial class Builder : pb::GeneratedBuilder<HealthCheckRequest, Builder> { return pb::JsonFormatter.Default.Format(this);
protected override Builder ThisBuilder { }
get { return this; }
}
public Builder() {
result = DefaultInstance;
resultIsReadOnly = true;
}
internal Builder(HealthCheckRequest cloneFrom) {
result = cloneFrom;
resultIsReadOnly = true;
}
private bool resultIsReadOnly;
private HealthCheckRequest result;
private HealthCheckRequest PrepareBuilder() {
if (resultIsReadOnly) {
HealthCheckRequest original = result;
result = new HealthCheckRequest();
resultIsReadOnly = false;
MergeFrom(original);
}
return result;
}
public override bool IsInitialized {
get { return result.IsInitialized; }
}
protected override HealthCheckRequest MessageBeingBuilt {
get { return PrepareBuilder(); }
}
public override Builder Clear() {
result = DefaultInstance;
resultIsReadOnly = true;
return this;
}
public override Builder Clone() { public void WriteTo(pb::CodedOutputStream output) {
if (resultIsReadOnly) { if (Host.Length != 0) {
return new Builder(result); output.WriteRawTag(10);
} else { output.WriteString(Host);
return new Builder().MergeFrom(result);
}
} }
if (Service.Length != 0) {
public override pbd::MessageDescriptor DescriptorForType { output.WriteRawTag(18);
get { return global::Grpc.Health.V1Alpha.HealthCheckRequest.Descriptor; } output.WriteString(Service);
} }
}
public override HealthCheckRequest DefaultInstanceForType { public int CalculateSize() {
get { return global::Grpc.Health.V1Alpha.HealthCheckRequest.DefaultInstance; } int size = 0;
if (Host.Length != 0) {
size += 1 + pb::CodedOutputStream.ComputeStringSize(Host);
} }
if (Service.Length != 0) {
public override HealthCheckRequest BuildPartial() { size += 1 + pb::CodedOutputStream.ComputeStringSize(Service);
if (resultIsReadOnly) {
return result;
}
resultIsReadOnly = true;
return result.MakeReadOnly();
} }
return size;
}
public override Builder MergeFrom(pb::IMessage other) { public void MergeFrom(HealthCheckRequest other) {
if (other is HealthCheckRequest) { if (other == null) {
return MergeFrom((HealthCheckRequest) other); return;
} else {
base.MergeFrom(other);
return this;
}
} }
if (other.Host.Length != 0) {
public override Builder MergeFrom(HealthCheckRequest other) { Host = other.Host;
if (other == global::Grpc.Health.V1Alpha.HealthCheckRequest.DefaultInstance) return this;
PrepareBuilder();
if (other.HasHost) {
Host = other.Host;
}
if (other.HasService) {
Service = other.Service;
}
this.MergeUnknownFields(other.UnknownFields);
return this;
} }
if (other.Service.Length != 0) {
public override Builder MergeFrom(pb::ICodedInputStream input) { Service = other.Service;
return MergeFrom(input, pb::ExtensionRegistry.Empty);
} }
}
public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { public void MergeFrom(pb::CodedInputStream input) {
PrepareBuilder(); uint tag;
pb::UnknownFieldSet.Builder unknownFields = null; while ((tag = input.ReadTag()) != 0) {
uint tag; switch(tag) {
string field_name; default:
while (input.ReadTag(out tag, out field_name)) { input.SkipLastField();
if(tag == 0 && field_name != null) { break;
int field_ordinal = global::System.Array.BinarySearch(_healthCheckRequestFieldNames, field_name, global::System.StringComparer.Ordinal); case 10: {
if(field_ordinal >= 0) Host = input.ReadString();
tag = _healthCheckRequestFieldTags[field_ordinal]; break;
else {
if (unknownFields == null) {
unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields);
}
ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name);
continue;
}
} }
switch (tag) { case 18: {
case 0: { Service = input.ReadString();
throw pb::InvalidProtocolBufferException.InvalidTag(); break;
}
default: {
if (pb::WireFormat.IsEndGroupTag(tag)) {
if (unknownFields != null) {
this.UnknownFields = unknownFields.Build();
}
return this;
}
if (unknownFields == null) {
unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields);
}
ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name);
break;
}
case 10: {
result.hasHost = input.ReadString(ref result.host_);
break;
}
case 18: {
result.hasService = input.ReadString(ref result.service_);
break;
}
} }
} }
if (unknownFields != null) {
this.UnknownFields = unknownFields.Build();
}
return this;
}
public bool HasHost {
get { return result.hasHost; }
}
public string Host {
get { return result.Host; }
set { SetHost(value); }
}
public Builder SetHost(string value) {
pb::ThrowHelper.ThrowIfNull(value, "value");
PrepareBuilder();
result.hasHost = true;
result.host_ = value;
return this;
}
public Builder ClearHost() {
PrepareBuilder();
result.hasHost = false;
result.host_ = "";
return this;
}
public bool HasService {
get { return result.hasService; }
}
public string Service {
get { return result.Service; }
set { SetService(value); }
} }
public Builder SetService(string value) {
pb::ThrowHelper.ThrowIfNull(value, "value");
PrepareBuilder();
result.hasService = true;
result.service_ = value;
return this;
}
public Builder ClearService() {
PrepareBuilder();
result.hasService = false;
result.service_ = "";
return this;
}
}
static HealthCheckRequest() {
object.ReferenceEquals(global::Grpc.Health.V1Alpha.Proto.Health.Descriptor, null);
} }
} }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
public sealed partial class HealthCheckResponse : pb::GeneratedMessage<HealthCheckResponse, HealthCheckResponse.Builder> { public sealed partial class HealthCheckResponse : pb::IMessage<HealthCheckResponse> {
private HealthCheckResponse() { } private static readonly pb::MessageParser<HealthCheckResponse> _parser = new pb::MessageParser<HealthCheckResponse>(() => new HealthCheckResponse());
private static readonly HealthCheckResponse defaultInstance = new HealthCheckResponse().MakeReadOnly(); public static pb::MessageParser<HealthCheckResponse> Parser { get { return _parser; } }
private static readonly string[] _healthCheckResponseFieldNames = new string[] { "status" };
private static readonly uint[] _healthCheckResponseFieldTags = new uint[] { 8 };
public static HealthCheckResponse DefaultInstance {
get { return defaultInstance; }
}
public override HealthCheckResponse DefaultInstanceForType { public static pbr::MessageDescriptor Descriptor {
get { return DefaultInstance; } get { return global::Grpc.Health.V1Alpha.Proto.Health.Descriptor.MessageTypes[1]; }
} }
protected override HealthCheckResponse ThisMessage { pbr::MessageDescriptor pb::IMessage.Descriptor {
get { return this; } get { return Descriptor; }
} }
public static pbd::MessageDescriptor Descriptor { public HealthCheckResponse() {
get { return global::Grpc.Health.V1Alpha.Proto.Health.internal__static_grpc_health_v1alpha_HealthCheckResponse__Descriptor; } OnConstruction();
} }
protected override pb::FieldAccess.FieldAccessorTable<HealthCheckResponse, HealthCheckResponse.Builder> InternalFieldAccessors { partial void OnConstruction();
get { return global::Grpc.Health.V1Alpha.Proto.Health.internal__static_grpc_health_v1alpha_HealthCheckResponse__FieldAccessorTable; }
}
#region Nested types public HealthCheckResponse(HealthCheckResponse other) : this() {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()] status_ = other.status_;
public static partial class Types { }
public enum ServingStatus {
UNKNOWN = 0,
SERVING = 1,
NOT_SERVING = 2,
}
public HealthCheckResponse Clone() {
return new HealthCheckResponse(this);
} }
#endregion
public const int StatusFieldNumber = 1; public const int StatusFieldNumber = 1;
private bool hasStatus;
private global::Grpc.Health.V1Alpha.HealthCheckResponse.Types.ServingStatus status_ = global::Grpc.Health.V1Alpha.HealthCheckResponse.Types.ServingStatus.UNKNOWN; private global::Grpc.Health.V1Alpha.HealthCheckResponse.Types.ServingStatus status_ = global::Grpc.Health.V1Alpha.HealthCheckResponse.Types.ServingStatus.UNKNOWN;
public bool HasStatus {
get { return hasStatus; }
}
public global::Grpc.Health.V1Alpha.HealthCheckResponse.Types.ServingStatus Status { public global::Grpc.Health.V1Alpha.HealthCheckResponse.Types.ServingStatus Status {
get { return status_; } get { return status_; }
} set {
status_ = value;
public override bool IsInitialized {
get {
return true;
} }
} }
public override void WriteTo(pb::ICodedOutputStream output) { public override bool Equals(object other) {
CalcSerializedSize(); return Equals(other as HealthCheckResponse);
string[] field_names = _healthCheckResponseFieldNames;
if (hasStatus) {
output.WriteEnum(1, field_names[0], (int) Status, Status);
}
UnknownFields.WriteTo(output);
} }
private int memoizedSerializedSize = -1; public bool Equals(HealthCheckResponse other) {
public override int SerializedSize { if (ReferenceEquals(other, null)) {
get { return false;
int size = memoizedSerializedSize;
if (size != -1) return size;
return CalcSerializedSize();
} }
} if (ReferenceEquals(other, this)) {
return true;
private int CalcSerializedSize() {
int size = memoizedSerializedSize;
if (size != -1) return size;
size = 0;
if (hasStatus) {
size += pb::CodedOutputStream.ComputeEnumSize(1, (int) Status);
} }
size += UnknownFields.SerializedSize; if (Status != other.Status) return false;
memoizedSerializedSize = size; return true;
return size;
}
public static HealthCheckResponse ParseFrom(pb::ByteString data) {
return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed();
}
public static HealthCheckResponse ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) {
return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed();
}
public static HealthCheckResponse ParseFrom(byte[] data) {
return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed();
}
public static HealthCheckResponse ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) {
return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed();
}
public static HealthCheckResponse ParseFrom(global::System.IO.Stream input) {
return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
}
public static HealthCheckResponse ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed();
}
public static HealthCheckResponse ParseDelimitedFrom(global::System.IO.Stream input) {
return CreateBuilder().MergeDelimitedFrom(input).BuildParsed();
}
public static HealthCheckResponse ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed();
}
public static HealthCheckResponse ParseFrom(pb::ICodedInputStream input) {
return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
}
public static HealthCheckResponse ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed();
}
private HealthCheckResponse MakeReadOnly() {
return this;
} }
public static Builder CreateBuilder() { return new Builder(); } public override int GetHashCode() {
public override Builder ToBuilder() { return CreateBuilder(this); } int hash = 1;
public override Builder CreateBuilderForType() { return new Builder(); } if (Status != global::Grpc.Health.V1Alpha.HealthCheckResponse.Types.ServingStatus.UNKNOWN) hash ^= Status.GetHashCode();
public static Builder CreateBuilder(HealthCheckResponse prototype) { return hash;
return new Builder(prototype);
} }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public override string ToString() {
public sealed partial class Builder : pb::GeneratedBuilder<HealthCheckResponse, Builder> { return pb::JsonFormatter.Default.Format(this);
protected override Builder ThisBuilder { }
get { return this; }
}
public Builder() {
result = DefaultInstance;
resultIsReadOnly = true;
}
internal Builder(HealthCheckResponse cloneFrom) {
result = cloneFrom;
resultIsReadOnly = true;
}
private bool resultIsReadOnly;
private HealthCheckResponse result;
private HealthCheckResponse PrepareBuilder() {
if (resultIsReadOnly) {
HealthCheckResponse original = result;
result = new HealthCheckResponse();
resultIsReadOnly = false;
MergeFrom(original);
}
return result;
}
public override bool IsInitialized {
get { return result.IsInitialized; }
}
protected override HealthCheckResponse MessageBeingBuilt {
get { return PrepareBuilder(); }
}
public override Builder Clear() {
result = DefaultInstance;
resultIsReadOnly = true;
return this;
}
public override Builder Clone() {
if (resultIsReadOnly) {
return new Builder(result);
} else {
return new Builder().MergeFrom(result);
}
}
public override pbd::MessageDescriptor DescriptorForType {
get { return global::Grpc.Health.V1Alpha.HealthCheckResponse.Descriptor; }
}
public override HealthCheckResponse DefaultInstanceForType {
get { return global::Grpc.Health.V1Alpha.HealthCheckResponse.DefaultInstance; }
}
public override HealthCheckResponse BuildPartial() { public void WriteTo(pb::CodedOutputStream output) {
if (resultIsReadOnly) { if (Status != global::Grpc.Health.V1Alpha.HealthCheckResponse.Types.ServingStatus.UNKNOWN) {
return result; output.WriteRawTag(8);
} output.WriteEnum((int) Status);
resultIsReadOnly = true;
return result.MakeReadOnly();
} }
}
public override Builder MergeFrom(pb::IMessage other) { public int CalculateSize() {
if (other is HealthCheckResponse) { int size = 0;
return MergeFrom((HealthCheckResponse) other); if (Status != global::Grpc.Health.V1Alpha.HealthCheckResponse.Types.ServingStatus.UNKNOWN) {
} else { size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) Status);
base.MergeFrom(other);
return this;
}
} }
return size;
}
public override Builder MergeFrom(HealthCheckResponse other) { public void MergeFrom(HealthCheckResponse other) {
if (other == global::Grpc.Health.V1Alpha.HealthCheckResponse.DefaultInstance) return this; if (other == null) {
PrepareBuilder(); return;
if (other.HasStatus) {
Status = other.Status;
}
this.MergeUnknownFields(other.UnknownFields);
return this;
} }
if (other.Status != global::Grpc.Health.V1Alpha.HealthCheckResponse.Types.ServingStatus.UNKNOWN) {
public override Builder MergeFrom(pb::ICodedInputStream input) { Status = other.Status;
return MergeFrom(input, pb::ExtensionRegistry.Empty);
} }
}
public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { public void MergeFrom(pb::CodedInputStream input) {
PrepareBuilder(); uint tag;
pb::UnknownFieldSet.Builder unknownFields = null; while ((tag = input.ReadTag()) != 0) {
uint tag; switch(tag) {
string field_name; default:
while (input.ReadTag(out tag, out field_name)) { input.SkipLastField();
if(tag == 0 && field_name != null) { break;
int field_ordinal = global::System.Array.BinarySearch(_healthCheckResponseFieldNames, field_name, global::System.StringComparer.Ordinal); case 8: {
if(field_ordinal >= 0) status_ = (global::Grpc.Health.V1Alpha.HealthCheckResponse.Types.ServingStatus) input.ReadEnum();
tag = _healthCheckResponseFieldTags[field_ordinal]; break;
else {
if (unknownFields == null) {
unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields);
}
ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name);
continue;
}
} }
switch (tag) {
case 0: {
throw pb::InvalidProtocolBufferException.InvalidTag();
}
default: {
if (pb::WireFormat.IsEndGroupTag(tag)) {
if (unknownFields != null) {
this.UnknownFields = unknownFields.Build();
}
return this;
}
if (unknownFields == null) {
unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields);
}
ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name);
break;
}
case 8: {
object unknown;
if(input.ReadEnum(ref result.status_, out unknown)) {
result.hasStatus = true;
} else if(unknown is int) {
if (unknownFields == null) {
unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields);
}
unknownFields.MergeVarintField(1, (ulong)(int)unknown);
}
break;
}
}
}
if (unknownFields != null) {
this.UnknownFields = unknownFields.Build();
} }
return this;
} }
}
#region Nested types
public bool HasStatus { [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
get { return result.hasStatus; } public static partial class Types {
} public enum ServingStatus {
public global::Grpc.Health.V1Alpha.HealthCheckResponse.Types.ServingStatus Status { UNKNOWN = 0,
get { return result.Status; } SERVING = 1,
set { SetStatus(value); } NOT_SERVING = 2,
}
public Builder SetStatus(global::Grpc.Health.V1Alpha.HealthCheckResponse.Types.ServingStatus value) {
PrepareBuilder();
result.hasStatus = true;
result.status_ = value;
return this;
}
public Builder ClearStatus() {
PrepareBuilder();
result.hasStatus = false;
result.status_ = global::Grpc.Health.V1Alpha.HealthCheckResponse.Types.ServingStatus.UNKNOWN;
return this;
} }
} }
static HealthCheckResponse() { #endregion
object.ReferenceEquals(global::Grpc.Health.V1Alpha.Proto.Health.Descriptor, null);
}
} }
#endregion #endregion

@ -12,8 +12,8 @@ namespace Grpc.Health.V1Alpha {
{ {
static readonly string __ServiceName = "grpc.health.v1alpha.Health"; static readonly string __ServiceName = "grpc.health.v1alpha.Health";
static readonly Marshaller<global::Grpc.Health.V1Alpha.HealthCheckRequest> __Marshaller_HealthCheckRequest = Marshallers.Create((arg) => arg.ToByteArray(), global::Grpc.Health.V1Alpha.HealthCheckRequest.ParseFrom); static readonly Marshaller<global::Grpc.Health.V1Alpha.HealthCheckRequest> __Marshaller_HealthCheckRequest = Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Health.V1Alpha.HealthCheckRequest.Parser.ParseFrom);
static readonly Marshaller<global::Grpc.Health.V1Alpha.HealthCheckResponse> __Marshaller_HealthCheckResponse = Marshallers.Create((arg) => arg.ToByteArray(), global::Grpc.Health.V1Alpha.HealthCheckResponse.ParseFrom); static readonly Marshaller<global::Grpc.Health.V1Alpha.HealthCheckResponse> __Marshaller_HealthCheckResponse = Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Health.V1Alpha.HealthCheckResponse.Parser.ParseFrom);
static readonly Method<global::Grpc.Health.V1Alpha.HealthCheckRequest, global::Grpc.Health.V1Alpha.HealthCheckResponse> __Method_Check = new Method<global::Grpc.Health.V1Alpha.HealthCheckRequest, global::Grpc.Health.V1Alpha.HealthCheckResponse>( static readonly Method<global::Grpc.Health.V1Alpha.HealthCheckRequest, global::Grpc.Health.V1Alpha.HealthCheckResponse> __Method_Check = new Method<global::Grpc.Health.V1Alpha.HealthCheckRequest, global::Grpc.Health.V1Alpha.HealthCheckResponse>(
MethodType.Unary, MethodType.Unary,
@ -22,6 +22,12 @@ namespace Grpc.Health.V1Alpha {
__Marshaller_HealthCheckRequest, __Marshaller_HealthCheckRequest,
__Marshaller_HealthCheckResponse); __Marshaller_HealthCheckResponse);
// service descriptor
public static global::Google.Protobuf.Reflection.ServiceDescriptor Descriptor
{
get { return global::Grpc.Health.V1Alpha.Proto.Health.Descriptor.Services[0]; }
}
// client interface // client interface
public interface IHealthClient public interface IHealthClient
{ {

@ -105,8 +105,8 @@ namespace Grpc.HealthCheck
{ {
lock (myLock) lock (myLock)
{ {
var host = request.HasHost ? request.Host : ""; var host = request.Host;
var service = request.HasService ? request.Service : ""; var service = request.Service;
HealthCheckResponse.Types.ServingStatus status; HealthCheckResponse.Types.ServingStatus status;
if (!statusMap.TryGetValue(CreateKey(host, service), out status)) if (!statusMap.TryGetValue(CreateKey(host, service), out status))
@ -114,7 +114,7 @@ namespace Grpc.HealthCheck
// TODO(jtattermusch): returning specific status from server handler is not supported yet. // TODO(jtattermusch): returning specific status from server handler is not supported yet.
throw new RpcException(new Status(StatusCode.NotFound, "")); throw new RpcException(new Status(StatusCode.NotFound, ""));
} }
return Task.FromResult(HealthCheckResponse.CreateBuilder().SetStatus(status).Build()); return Task.FromResult(new HealthCheckResponse { Status = status });
} }
} }

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<packages> <packages>
<package id="Google.ProtocolBuffers" version="2.4.1.555" targetFramework="net45" /> <package id="Google.Protobuf" version="3.0.0-alpha4" targetFramework="net45" />
<package id="Ix-Async" version="1.2.3" targetFramework="net45" /> <package id="Ix-Async" version="1.2.3" targetFramework="net45" />
</packages> </packages>

@ -28,14 +28,14 @@
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// TODO(jtattermusch): switch to proto3 once C# supports that. // TODO(jtattermusch): switch to proto3 once C# supports that.
syntax = "proto2"; syntax = "proto3";
package grpc.health.v1alpha; package grpc.health.v1alpha;
option csharp_namespace = "Grpc.Health.V1Alpha"; option csharp_namespace = "Grpc.Health.V1Alpha";
message HealthCheckRequest { message HealthCheckRequest {
optional string host = 1; string host = 1;
optional string service = 2; string service = 2;
} }
message HealthCheckResponse { message HealthCheckResponse {
@ -44,7 +44,7 @@ message HealthCheckResponse {
SERVING = 1; SERVING = 1;
NOT_SERVING = 2; NOT_SERVING = 2;
} }
optional ServingStatus status = 1; ServingStatus status = 1;
} }
service Health { service Health {

@ -1,47 +1,34 @@
// Generated by ProtoGen, Version=2.4.1.521, Culture=neutral, PublicKeyToken=17b3b1f090c3ea48. DO NOT EDIT! // Generated by the protocol buffer compiler. DO NOT EDIT!
// source: empty.proto
#pragma warning disable 1591, 0612, 3021 #pragma warning disable 1591, 0612, 3021
#region Designer generated code #region Designer generated code
using pb = global::Google.ProtocolBuffers; using pb = global::Google.Protobuf;
using pbc = global::Google.ProtocolBuffers.Collections; using pbc = global::Google.Protobuf.Collections;
using pbd = global::Google.ProtocolBuffers.Descriptors; using pbr = global::Google.Protobuf.Reflection;
using scg = global::System.Collections.Generic; using scg = global::System.Collections.Generic;
namespace grpc.testing { namespace Grpc.Testing {
namespace Proto { namespace Proto {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
public static partial class Empty { public static partial class Empty {
#region Extension registration
public static void RegisterAllExtensions(pb::ExtensionRegistry registry) {
}
#endregion
#region Static variables
internal static pbd::MessageDescriptor internal__static_grpc_testing_Empty__Descriptor;
internal static pb::FieldAccess.FieldAccessorTable<global::grpc.testing.Empty, global::grpc.testing.Empty.Builder> internal__static_grpc_testing_Empty__FieldAccessorTable;
#endregion
#region Descriptor #region Descriptor
public static pbd::FileDescriptor Descriptor { public static pbr::FileDescriptor Descriptor {
get { return descriptor; } get { return descriptor; }
} }
private static pbd::FileDescriptor descriptor; private static pbr::FileDescriptor descriptor;
static Empty() { static Empty() {
byte[] descriptorData = global::System.Convert.FromBase64String( byte[] descriptorData = global::System.Convert.FromBase64String(
string.Concat( string.Concat(
"CgtlbXB0eS5wcm90bxIMZ3JwYy50ZXN0aW5nIgcKBUVtcHR5")); "CgtlbXB0eS5wcm90bxIMZ3JwYy50ZXN0aW5nIgcKBUVtcHR5YgZwcm90bzM="));
pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) { descriptor = pbr::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData,
descriptor = root; new pbr::FileDescriptor[] { },
internal__static_grpc_testing_Empty__Descriptor = Descriptor.MessageTypes[0]; new pbr::GeneratedCodeInfo(null, new pbr::GeneratedCodeInfo[] {
internal__static_grpc_testing_Empty__FieldAccessorTable = new pbr::GeneratedCodeInfo(typeof(global::Grpc.Testing.Empty), null, null, null, null)
new pb::FieldAccess.FieldAccessorTable<global::grpc.testing.Empty, global::grpc.testing.Empty.Builder>(internal__static_grpc_testing_Empty__Descriptor, }));
new string[] { });
return null;
};
pbd::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData,
new pbd::FileDescriptor[] {
}, assigner);
} }
#endregion #endregion
@ -49,230 +36,79 @@ namespace grpc.testing {
} }
#region Messages #region Messages
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
public sealed partial class Empty : pb::GeneratedMessage<Empty, Empty.Builder> { public sealed partial class Empty : pb::IMessage<Empty> {
private Empty() { } private static readonly pb::MessageParser<Empty> _parser = new pb::MessageParser<Empty>(() => new Empty());
private static readonly Empty defaultInstance = new Empty().MakeReadOnly(); public static pb::MessageParser<Empty> Parser { get { return _parser; } }
private static readonly string[] _emptyFieldNames = new string[] { };
private static readonly uint[] _emptyFieldTags = new uint[] { };
public static Empty DefaultInstance {
get { return defaultInstance; }
}
public override Empty DefaultInstanceForType { public static pbr::MessageDescriptor Descriptor {
get { return DefaultInstance; } get { return global::Grpc.Testing.Proto.Empty.Descriptor.MessageTypes[0]; }
} }
protected override Empty ThisMessage { pbr::MessageDescriptor pb::IMessage.Descriptor {
get { return this; } get { return Descriptor; }
} }
public static pbd::MessageDescriptor Descriptor { public Empty() {
get { return global::grpc.testing.Proto.Empty.internal__static_grpc_testing_Empty__Descriptor; } OnConstruction();
} }
protected override pb::FieldAccess.FieldAccessorTable<Empty, Empty.Builder> InternalFieldAccessors { partial void OnConstruction();
get { return global::grpc.testing.Proto.Empty.internal__static_grpc_testing_Empty__FieldAccessorTable; }
}
public override bool IsInitialized { public Empty(Empty other) : this() {
get {
return true;
}
} }
public override void WriteTo(pb::ICodedOutputStream output) { public Empty Clone() {
int size = SerializedSize; return new Empty(this);
string[] field_names = _emptyFieldNames;
UnknownFields.WriteTo(output);
} }
private int memoizedSerializedSize = -1; public override bool Equals(object other) {
public override int SerializedSize { return Equals(other as Empty);
get { }
int size = memoizedSerializedSize;
if (size != -1) return size;
size = 0; public bool Equals(Empty other) {
size += UnknownFields.SerializedSize; if (ReferenceEquals(other, null)) {
memoizedSerializedSize = size; return false;
return size; }
if (ReferenceEquals(other, this)) {
return true;
} }
return true;
} }
public static Empty ParseFrom(pb::ByteString data) { public override int GetHashCode() {
return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); int hash = 1;
} return hash;
public static Empty ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) {
return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed();
}
public static Empty ParseFrom(byte[] data) {
return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed();
}
public static Empty ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) {
return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed();
}
public static Empty ParseFrom(global::System.IO.Stream input) {
return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
}
public static Empty ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed();
}
public static Empty ParseDelimitedFrom(global::System.IO.Stream input) {
return CreateBuilder().MergeDelimitedFrom(input).BuildParsed();
}
public static Empty ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed();
}
public static Empty ParseFrom(pb::ICodedInputStream input) {
return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
}
public static Empty ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed();
}
private Empty MakeReadOnly() {
return this;
} }
public static Builder CreateBuilder() { return new Builder(); } public override string ToString() {
public override Builder ToBuilder() { return CreateBuilder(this); } return pb::JsonFormatter.Default.Format(this);
public override Builder CreateBuilderForType() { return new Builder(); }
public static Builder CreateBuilder(Empty prototype) {
return new Builder(prototype);
} }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public void WriteTo(pb::CodedOutputStream output) {
public sealed partial class Builder : pb::GeneratedBuilder<Empty, Builder> { }
protected override Builder ThisBuilder {
get { return this; }
}
public Builder() {
result = DefaultInstance;
resultIsReadOnly = true;
}
internal Builder(Empty cloneFrom) {
result = cloneFrom;
resultIsReadOnly = true;
}
private bool resultIsReadOnly;
private Empty result;
private Empty PrepareBuilder() {
if (resultIsReadOnly) {
Empty original = result;
result = new Empty();
resultIsReadOnly = false;
MergeFrom(original);
}
return result;
}
public override bool IsInitialized {
get { return result.IsInitialized; }
}
protected override Empty MessageBeingBuilt {
get { return PrepareBuilder(); }
}
public override Builder Clear() {
result = DefaultInstance;
resultIsReadOnly = true;
return this;
}
public override Builder Clone() {
if (resultIsReadOnly) {
return new Builder(result);
} else {
return new Builder().MergeFrom(result);
}
}
public override pbd::MessageDescriptor DescriptorForType {
get { return global::grpc.testing.Empty.Descriptor; }
}
public override Empty DefaultInstanceForType {
get { return global::grpc.testing.Empty.DefaultInstance; }
}
public override Empty BuildPartial() {
if (resultIsReadOnly) {
return result;
}
resultIsReadOnly = true;
return result.MakeReadOnly();
}
public override Builder MergeFrom(pb::IMessage other) {
if (other is Empty) {
return MergeFrom((Empty) other);
} else {
base.MergeFrom(other);
return this;
}
}
public override Builder MergeFrom(Empty other) { public int CalculateSize() {
if (other == global::grpc.testing.Empty.DefaultInstance) return this; int size = 0;
PrepareBuilder(); return size;
this.MergeUnknownFields(other.UnknownFields); }
return this;
}
public override Builder MergeFrom(pb::ICodedInputStream input) { public void MergeFrom(Empty other) {
return MergeFrom(input, pb::ExtensionRegistry.Empty); if (other == null) {
return;
} }
}
public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { public void MergeFrom(pb::CodedInputStream input) {
PrepareBuilder(); uint tag;
pb::UnknownFieldSet.Builder unknownFields = null; while ((tag = input.ReadTag()) != 0) {
uint tag; switch(tag) {
string field_name; default:
while (input.ReadTag(out tag, out field_name)) { input.SkipLastField();
if(tag == 0 && field_name != null) { break;
int field_ordinal = global::System.Array.BinarySearch(_emptyFieldNames, field_name, global::System.StringComparer.Ordinal);
if(field_ordinal >= 0)
tag = _emptyFieldTags[field_ordinal];
else {
if (unknownFields == null) {
unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields);
}
ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name);
continue;
}
}
switch (tag) {
case 0: {
throw pb::InvalidProtocolBufferException.InvalidTag();
}
default: {
if (pb::WireFormat.IsEndGroupTag(tag)) {
if (unknownFields != null) {
this.UnknownFields = unknownFields.Build();
}
return this;
}
if (unknownFields == null) {
unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields);
}
ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name);
break;
}
}
}
if (unknownFields != null) {
this.UnknownFields = unknownFields.Build();
} }
return this;
} }
}
static Empty() {
object.ReferenceEquals(global::grpc.testing.Proto.Empty.Descriptor, null);
} }
} }
#endregion #endregion

@ -54,6 +54,10 @@
<SpecificVersion>False</SpecificVersion> <SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\Google.Apis.Core.1.9.3\lib\portable-net40+sl50+win+wpa81+wp80\Google.Apis.Core.dll</HintPath> <HintPath>..\packages\Google.Apis.Core.1.9.3\lib\portable-net40+sl50+win+wpa81+wp80\Google.Apis.Core.dll</HintPath>
</Reference> </Reference>
<Reference Include="Google.Protobuf, Version=3.0.0.0, Culture=neutral, PublicKeyToken=a7d26565bac4d604, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\Google.Protobuf.3.0.0-alpha4\lib\portable-net45+netcore45+wpa81+wp8\Google.Protobuf.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Threading.Tasks, Version=1.0.12.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"> <Reference Include="Microsoft.Threading.Tasks, Version=1.0.12.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion> <SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\Microsoft.Bcl.Async.1.0.168\lib\net40\Microsoft.Threading.Tasks.dll</HintPath> <HintPath>..\packages\Microsoft.Bcl.Async.1.0.168\lib\net40\Microsoft.Threading.Tasks.dll</HintPath>
@ -74,22 +78,11 @@
<HintPath>..\packages\NUnit.2.6.4\lib\nunit.framework.dll</HintPath> <HintPath>..\packages\NUnit.2.6.4\lib\nunit.framework.dll</HintPath>
</Reference> </Reference>
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="Google.ProtocolBuffers">
<HintPath>..\packages\Google.ProtocolBuffers.2.4.1.521\lib\net40\Google.ProtocolBuffers.dll</HintPath>
</Reference>
<Reference Include="System.Interactive.Async"> <Reference Include="System.Interactive.Async">
<HintPath>..\packages\Ix-Async.1.2.3\lib\net45\System.Interactive.Async.dll</HintPath> <HintPath>..\packages\Ix-Async.1.2.3\lib\net45\System.Interactive.Async.dll</HintPath>
</Reference> </Reference>
<Reference Include="System.Net" /> <Reference Include="System.Net" />
<Reference Include="System.Net.Http" /> <Reference Include="System.Net.Http" />
<Reference Include="System.Net.Http.Extensions, Version=2.2.29.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\Microsoft.Net.Http.2.2.29\lib\net45\System.Net.Http.Extensions.dll</HintPath>
</Reference>
<Reference Include="System.Net.Http.Primitives, Version=4.2.29.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\Microsoft.Net.Http.2.2.29\lib\net45\System.Net.Http.Primitives.dll</HintPath>
</Reference>
<Reference Include="System.Net.Http.WebRequest" /> <Reference Include="System.Net.Http.WebRequest" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
@ -106,6 +99,7 @@
<Compile Include="TestCredentials.cs" /> <Compile Include="TestCredentials.cs" />
<Compile Include="TestGrpc.cs" /> <Compile Include="TestGrpc.cs" />
<Compile Include="SslCredentialsTest.cs" /> <Compile Include="SslCredentialsTest.cs" />
<Compile Include="Test.cs" />
</ItemGroup> </ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<ItemGroup> <ItemGroup>

@ -37,13 +37,12 @@ using System.Text.RegularExpressions;
using System.Threading; using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
using Google.Apis.Auth.OAuth2;
using Google.ProtocolBuffers;
using grpc.testing;
using Grpc.Auth; using Grpc.Auth;
using Grpc.Core; using Grpc.Core;
using Grpc.Core.Utils; using Grpc.Core.Utils;
using Grpc.Testing;
using Google.Protobuf;
using Google.Apis.Auth.OAuth2;
using NUnit.Framework; using NUnit.Framework;
@ -183,7 +182,7 @@ namespace Grpc.IntegrationTesting
public static void RunEmptyUnary(TestService.ITestServiceClient client) public static void RunEmptyUnary(TestService.ITestServiceClient client)
{ {
Console.WriteLine("running empty_unary"); Console.WriteLine("running empty_unary");
var response = client.EmptyCall(Empty.DefaultInstance); var response = client.EmptyCall(new Empty());
Assert.IsNotNull(response); Assert.IsNotNull(response);
Console.WriteLine("Passed!"); Console.WriteLine("Passed!");
} }
@ -191,11 +190,12 @@ namespace Grpc.IntegrationTesting
public static void RunLargeUnary(TestService.ITestServiceClient client) public static void RunLargeUnary(TestService.ITestServiceClient client)
{ {
Console.WriteLine("running large_unary"); Console.WriteLine("running large_unary");
var request = SimpleRequest.CreateBuilder() var request = new SimpleRequest
.SetResponseType(PayloadType.COMPRESSABLE) {
.SetResponseSize(314159) ResponseType = PayloadType.COMPRESSABLE,
.SetPayload(CreateZerosPayload(271828)) ResponseSize = 314159,
.Build(); Payload = CreateZerosPayload(271828)
};
var response = client.UnaryCall(request); var response = client.UnaryCall(request);
@ -208,7 +208,7 @@ namespace Grpc.IntegrationTesting
{ {
Console.WriteLine("running client_streaming"); Console.WriteLine("running client_streaming");
var bodySizes = new List<int> { 27182, 8, 1828, 45904 }.ConvertAll((size) => StreamingInputCallRequest.CreateBuilder().SetPayload(CreateZerosPayload(size)).Build()); var bodySizes = new List<int> { 27182, 8, 1828, 45904 }.ConvertAll((size) => new StreamingInputCallRequest { Payload = CreateZerosPayload(size) });
using (var call = client.StreamingInputCall()) using (var call = client.StreamingInputCall())
{ {
@ -226,11 +226,11 @@ namespace Grpc.IntegrationTesting
var bodySizes = new List<int> { 31415, 9, 2653, 58979 }; var bodySizes = new List<int> { 31415, 9, 2653, 58979 };
var request = StreamingOutputCallRequest.CreateBuilder() var request = new StreamingOutputCallRequest
.SetResponseType(PayloadType.COMPRESSABLE) {
.AddRangeResponseParameters(bodySizes.ConvertAll( ResponseType = PayloadType.COMPRESSABLE,
(size) => ResponseParameters.CreateBuilder().SetSize(size).Build())) ResponseParameters = { bodySizes.ConvertAll((size) => new ResponseParameters { Size = size }) }
.Build(); };
using (var call = client.StreamingOutputCall(request)) using (var call = client.StreamingOutputCall(request))
{ {
@ -250,37 +250,45 @@ namespace Grpc.IntegrationTesting
using (var call = client.FullDuplexCall()) using (var call = client.FullDuplexCall())
{ {
await call.RequestStream.WriteAsync(StreamingOutputCallRequest.CreateBuilder() await call.RequestStream.WriteAsync(new StreamingOutputCallRequest
.SetResponseType(PayloadType.COMPRESSABLE) {
.AddResponseParameters(ResponseParameters.CreateBuilder().SetSize(31415)) ResponseType = PayloadType.COMPRESSABLE,
.SetPayload(CreateZerosPayload(27182)).Build()); ResponseParameters = { new ResponseParameters { Size = 31415 } },
Payload = CreateZerosPayload(27182)
});
Assert.IsTrue(await call.ResponseStream.MoveNext()); Assert.IsTrue(await call.ResponseStream.MoveNext());
Assert.AreEqual(PayloadType.COMPRESSABLE, call.ResponseStream.Current.Payload.Type); Assert.AreEqual(PayloadType.COMPRESSABLE, call.ResponseStream.Current.Payload.Type);
Assert.AreEqual(31415, call.ResponseStream.Current.Payload.Body.Length); Assert.AreEqual(31415, call.ResponseStream.Current.Payload.Body.Length);
await call.RequestStream.WriteAsync(StreamingOutputCallRequest.CreateBuilder() await call.RequestStream.WriteAsync(new StreamingOutputCallRequest
.SetResponseType(PayloadType.COMPRESSABLE) {
.AddResponseParameters(ResponseParameters.CreateBuilder().SetSize(9)) ResponseType = PayloadType.COMPRESSABLE,
.SetPayload(CreateZerosPayload(8)).Build()); ResponseParameters = { new ResponseParameters { Size = 9 } },
Payload = CreateZerosPayload(8)
});
Assert.IsTrue(await call.ResponseStream.MoveNext()); Assert.IsTrue(await call.ResponseStream.MoveNext());
Assert.AreEqual(PayloadType.COMPRESSABLE, call.ResponseStream.Current.Payload.Type); Assert.AreEqual(PayloadType.COMPRESSABLE, call.ResponseStream.Current.Payload.Type);
Assert.AreEqual(9, call.ResponseStream.Current.Payload.Body.Length); Assert.AreEqual(9, call.ResponseStream.Current.Payload.Body.Length);
await call.RequestStream.WriteAsync(StreamingOutputCallRequest.CreateBuilder() await call.RequestStream.WriteAsync(new StreamingOutputCallRequest
.SetResponseType(PayloadType.COMPRESSABLE) {
.AddResponseParameters(ResponseParameters.CreateBuilder().SetSize(2653)) ResponseType = PayloadType.COMPRESSABLE,
.SetPayload(CreateZerosPayload(1828)).Build()); ResponseParameters = { new ResponseParameters { Size = 2653 } },
Payload = CreateZerosPayload(1828)
});
Assert.IsTrue(await call.ResponseStream.MoveNext()); Assert.IsTrue(await call.ResponseStream.MoveNext());
Assert.AreEqual(PayloadType.COMPRESSABLE, call.ResponseStream.Current.Payload.Type); Assert.AreEqual(PayloadType.COMPRESSABLE, call.ResponseStream.Current.Payload.Type);
Assert.AreEqual(2653, call.ResponseStream.Current.Payload.Body.Length); Assert.AreEqual(2653, call.ResponseStream.Current.Payload.Body.Length);
await call.RequestStream.WriteAsync(StreamingOutputCallRequest.CreateBuilder() await call.RequestStream.WriteAsync(new StreamingOutputCallRequest
.SetResponseType(PayloadType.COMPRESSABLE) {
.AddResponseParameters(ResponseParameters.CreateBuilder().SetSize(58979)) ResponseType = PayloadType.COMPRESSABLE,
.SetPayload(CreateZerosPayload(45904)).Build()); ResponseParameters = { new ResponseParameters { Size = 58979 } },
Payload = CreateZerosPayload(45904)
});
Assert.IsTrue(await call.ResponseStream.MoveNext()); Assert.IsTrue(await call.ResponseStream.MoveNext());
Assert.AreEqual(PayloadType.COMPRESSABLE, call.ResponseStream.Current.Payload.Type); Assert.AreEqual(PayloadType.COMPRESSABLE, call.ResponseStream.Current.Payload.Type);
@ -313,13 +321,14 @@ namespace Grpc.IntegrationTesting
credential = credential.CreateScoped(new[] { AuthScope }); credential = credential.CreateScoped(new[] { AuthScope });
client.HeaderInterceptor = AuthInterceptors.FromCredential(credential); client.HeaderInterceptor = AuthInterceptors.FromCredential(credential);
var request = SimpleRequest.CreateBuilder() var request = new SimpleRequest
.SetResponseType(PayloadType.COMPRESSABLE) {
.SetResponseSize(314159) ResponseType = PayloadType.COMPRESSABLE,
.SetPayload(CreateZerosPayload(271828)) ResponseSize = 314159,
.SetFillUsername(true) Payload = CreateZerosPayload(271828),
.SetFillOauthScope(true) FillUsername = true,
.Build(); FillOauthScope = true
};
var response = client.UnaryCall(request); var response = client.UnaryCall(request);
@ -337,13 +346,14 @@ namespace Grpc.IntegrationTesting
Assert.IsFalse(credential.IsCreateScopedRequired); Assert.IsFalse(credential.IsCreateScopedRequired);
client.HeaderInterceptor = AuthInterceptors.FromCredential(credential); client.HeaderInterceptor = AuthInterceptors.FromCredential(credential);
var request = SimpleRequest.CreateBuilder() var request = new SimpleRequest
.SetResponseType(PayloadType.COMPRESSABLE) {
.SetResponseSize(314159) ResponseType = PayloadType.COMPRESSABLE,
.SetPayload(CreateZerosPayload(271828)) ResponseSize = 314159,
.SetFillUsername(true) Payload = CreateZerosPayload(271828),
.SetFillOauthScope(true) FillUsername = true,
.Build(); FillOauthScope = true
};
var response = client.UnaryCall(request); var response = client.UnaryCall(request);
@ -362,13 +372,14 @@ namespace Grpc.IntegrationTesting
Assert.IsTrue(credential.IsCreateScopedRequired); Assert.IsTrue(credential.IsCreateScopedRequired);
client.HeaderInterceptor = AuthInterceptors.FromCredential(credential); client.HeaderInterceptor = AuthInterceptors.FromCredential(credential);
var request = SimpleRequest.CreateBuilder() var request = new SimpleRequest
.SetResponseType(PayloadType.COMPRESSABLE) {
.SetResponseSize(314159) ResponseType = PayloadType.COMPRESSABLE,
.SetPayload(CreateZerosPayload(271828)) ResponseSize = 314159,
.SetFillUsername(true) Payload = CreateZerosPayload(271828),
.SetFillOauthScope(true) FillUsername = true,
.Build(); FillOauthScope = true
};
var response = client.UnaryCall(request); var response = client.UnaryCall(request);
@ -386,10 +397,11 @@ namespace Grpc.IntegrationTesting
client.HeaderInterceptor = AuthInterceptors.FromAccessToken(oauth2Token); client.HeaderInterceptor = AuthInterceptors.FromAccessToken(oauth2Token);
var request = SimpleRequest.CreateBuilder() var request = new SimpleRequest
.SetFillUsername(true) {
.SetFillOauthScope(true) FillUsername = true,
.Build(); FillOauthScope = true
};
var response = client.UnaryCall(request); var response = client.UnaryCall(request);
@ -406,10 +418,11 @@ namespace Grpc.IntegrationTesting
string oauth2Token = await credential.GetAccessTokenForRequestAsync(); string oauth2Token = await credential.GetAccessTokenForRequestAsync();
var headerInterceptor = AuthInterceptors.FromAccessToken(oauth2Token); var headerInterceptor = AuthInterceptors.FromAccessToken(oauth2Token);
var request = SimpleRequest.CreateBuilder() var request = new SimpleRequest
.SetFillUsername(true) {
.SetFillOauthScope(true) FillUsername = true,
.Build(); FillOauthScope = true
};
var headers = new Metadata(); var headers = new Metadata();
headerInterceptor(null, "", headers); headerInterceptor(null, "", headers);
@ -444,10 +457,12 @@ namespace Grpc.IntegrationTesting
var cts = new CancellationTokenSource(); var cts = new CancellationTokenSource();
using (var call = client.FullDuplexCall(cancellationToken: cts.Token)) using (var call = client.FullDuplexCall(cancellationToken: cts.Token))
{ {
await call.RequestStream.WriteAsync(StreamingOutputCallRequest.CreateBuilder() await call.RequestStream.WriteAsync(new StreamingOutputCallRequest
.SetResponseType(PayloadType.COMPRESSABLE) {
.AddResponseParameters(ResponseParameters.CreateBuilder().SetSize(31415)) ResponseType = PayloadType.COMPRESSABLE,
.SetPayload(CreateZerosPayload(27182)).Build()); ResponseParameters = { new ResponseParameters { Size = 31415 } },
Payload = CreateZerosPayload(27182)
});
Assert.IsTrue(await call.ResponseStream.MoveNext()); Assert.IsTrue(await call.ResponseStream.MoveNext());
Assert.AreEqual(PayloadType.COMPRESSABLE, call.ResponseStream.Current.Payload.Type); Assert.AreEqual(PayloadType.COMPRESSABLE, call.ResponseStream.Current.Payload.Type);
@ -470,8 +485,7 @@ namespace Grpc.IntegrationTesting
{ {
try try
{ {
await call.RequestStream.WriteAsync(StreamingOutputCallRequest.CreateBuilder() await call.RequestStream.WriteAsync(new StreamingOutputCallRequest { Payload = CreateZerosPayload(27182) });
.SetPayload(CreateZerosPayload(27182)).Build());
} }
catch (InvalidOperationException) catch (InvalidOperationException)
{ {
@ -488,12 +502,12 @@ namespace Grpc.IntegrationTesting
public static void RunBenchmarkEmptyUnary(TestService.ITestServiceClient client) public static void RunBenchmarkEmptyUnary(TestService.ITestServiceClient client)
{ {
BenchmarkUtil.RunBenchmark(10000, 10000, BenchmarkUtil.RunBenchmark(10000, 10000,
() => { client.EmptyCall(Empty.DefaultInstance); }); () => { client.EmptyCall(new Empty()); });
} }
private static Payload CreateZerosPayload(int size) private static Payload CreateZerosPayload(int size)
{ {
return Payload.CreateBuilder().SetBody(ByteString.CopyFrom(new byte[size])).Build(); return new Payload { Body = ByteString.CopyFrom(new byte[size]) };
} }
private static ClientOptions ParseArguments(string[] args) private static ClientOptions ParseArguments(string[] args)

@ -36,9 +36,9 @@ using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Threading; using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
using grpc.testing;
using Grpc.Core; using Grpc.Core;
using Grpc.Core.Utils; using Grpc.Core.Utils;
using Grpc.Testing;
using NUnit.Framework; using NUnit.Framework;
namespace Grpc.IntegrationTesting namespace Grpc.IntegrationTesting

@ -37,10 +37,9 @@ using System.Diagnostics;
using System.IO; using System.IO;
using System.Text.RegularExpressions; using System.Text.RegularExpressions;
using System.Threading.Tasks; using System.Threading.Tasks;
using Google.ProtocolBuffers;
using grpc.testing;
using Grpc.Core; using Grpc.Core;
using Grpc.Core.Utils; using Grpc.Core.Utils;
using Grpc.Testing;
using NUnit.Framework; using NUnit.Framework;
namespace Grpc.IntegrationTesting namespace Grpc.IntegrationTesting

File diff suppressed because it is too large Load Diff

@ -37,9 +37,9 @@ using System.IO;
using System.Linq; using System.Linq;
using System.Threading; using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
using grpc.testing;
using Grpc.Core; using Grpc.Core;
using Grpc.Core.Utils; using Grpc.Core.Utils;
using Grpc.Testing;
using NUnit.Framework; using NUnit.Framework;
namespace Grpc.IntegrationTesting namespace Grpc.IntegrationTesting
@ -92,7 +92,7 @@ namespace Grpc.IntegrationTesting
[Test] [Test]
public void AuthenticatedClientAndServer() public void AuthenticatedClientAndServer()
{ {
var response = client.UnaryCall(SimpleRequest.CreateBuilder().SetResponseSize(10).Build()); var response = client.UnaryCall(new SimpleRequest { ResponseSize = 10 });
Assert.AreEqual(10, response.Payload.Body.Length); Assert.AreEqual(10, response.Payload.Body.Length);
} }
} }

@ -0,0 +1,48 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: test.proto
#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 Grpc.Testing {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
public static partial class Test {
#region Descriptor
public static pbr::FileDescriptor Descriptor {
get { return descriptor; }
}
private static pbr::FileDescriptor descriptor;
static Test() {
byte[] descriptorData = global::System.Convert.FromBase64String(
string.Concat(
"Cgp0ZXN0LnByb3RvEgxncnBjLnRlc3RpbmcaC2VtcHR5LnByb3RvGg5tZXNz",
"YWdlcy5wcm90bzK7BAoLVGVzdFNlcnZpY2USNQoJRW1wdHlDYWxsEhMuZ3Jw",
"Yy50ZXN0aW5nLkVtcHR5GhMuZ3JwYy50ZXN0aW5nLkVtcHR5EkYKCVVuYXJ5",
"Q2FsbBIbLmdycGMudGVzdGluZy5TaW1wbGVSZXF1ZXN0GhwuZ3JwYy50ZXN0",
"aW5nLlNpbXBsZVJlc3BvbnNlEmwKE1N0cmVhbWluZ091dHB1dENhbGwSKC5n",
"cnBjLnRlc3RpbmcuU3RyZWFtaW5nT3V0cHV0Q2FsbFJlcXVlc3QaKS5ncnBj",
"LnRlc3RpbmcuU3RyZWFtaW5nT3V0cHV0Q2FsbFJlc3BvbnNlMAESaQoSU3Ry",
"ZWFtaW5nSW5wdXRDYWxsEicuZ3JwYy50ZXN0aW5nLlN0cmVhbWluZ0lucHV0",
"Q2FsbFJlcXVlc3QaKC5ncnBjLnRlc3RpbmcuU3RyZWFtaW5nSW5wdXRDYWxs",
"UmVzcG9uc2UoARJpCg5GdWxsRHVwbGV4Q2FsbBIoLmdycGMudGVzdGluZy5T",
"dHJlYW1pbmdPdXRwdXRDYWxsUmVxdWVzdBopLmdycGMudGVzdGluZy5TdHJl",
"YW1pbmdPdXRwdXRDYWxsUmVzcG9uc2UoATABEmkKDkhhbGZEdXBsZXhDYWxs",
"EiguZ3JwYy50ZXN0aW5nLlN0cmVhbWluZ091dHB1dENhbGxSZXF1ZXN0Giku",
"Z3JwYy50ZXN0aW5nLlN0cmVhbWluZ091dHB1dENhbGxSZXNwb25zZSgBMAFi",
"BnByb3RvMw=="));
descriptor = pbr::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData,
new pbr::FileDescriptor[] { global::Grpc.Testing.Proto.Empty.Descriptor, global::Grpc.Testing.Messages.Descriptor, },
new pbr::GeneratedCodeInfo(null, null));
}
#endregion
}
}
#endregion Designer generated code

@ -37,8 +37,6 @@ using System.Diagnostics;
using System.IO; using System.IO;
using System.Text.RegularExpressions; using System.Text.RegularExpressions;
using System.Threading.Tasks; using System.Threading.Tasks;
using Google.ProtocolBuffers;
using grpc.testing;
using Grpc.Core; using Grpc.Core;
using Grpc.Core.Utils; using Grpc.Core.Utils;
using NUnit.Framework; using NUnit.Framework;

@ -7,91 +7,97 @@ using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
using Grpc.Core; using Grpc.Core;
namespace grpc.testing { namespace Grpc.Testing {
public static class TestService public static class TestService
{ {
static readonly string __ServiceName = "grpc.testing.TestService"; static readonly string __ServiceName = "grpc.testing.TestService";
static readonly Marshaller<global::grpc.testing.Empty> __Marshaller_Empty = Marshallers.Create((arg) => arg.ToByteArray(), global::grpc.testing.Empty.ParseFrom); static readonly Marshaller<global::Grpc.Testing.Empty> __Marshaller_Empty = Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.Empty.Parser.ParseFrom);
static readonly Marshaller<global::grpc.testing.SimpleRequest> __Marshaller_SimpleRequest = Marshallers.Create((arg) => arg.ToByteArray(), global::grpc.testing.SimpleRequest.ParseFrom); static readonly Marshaller<global::Grpc.Testing.SimpleRequest> __Marshaller_SimpleRequest = Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.SimpleRequest.Parser.ParseFrom);
static readonly Marshaller<global::grpc.testing.SimpleResponse> __Marshaller_SimpleResponse = Marshallers.Create((arg) => arg.ToByteArray(), global::grpc.testing.SimpleResponse.ParseFrom); static readonly Marshaller<global::Grpc.Testing.SimpleResponse> __Marshaller_SimpleResponse = Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.SimpleResponse.Parser.ParseFrom);
static readonly Marshaller<global::grpc.testing.StreamingOutputCallRequest> __Marshaller_StreamingOutputCallRequest = Marshallers.Create((arg) => arg.ToByteArray(), global::grpc.testing.StreamingOutputCallRequest.ParseFrom); static readonly Marshaller<global::Grpc.Testing.StreamingOutputCallRequest> __Marshaller_StreamingOutputCallRequest = Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.StreamingOutputCallRequest.Parser.ParseFrom);
static readonly Marshaller<global::grpc.testing.StreamingOutputCallResponse> __Marshaller_StreamingOutputCallResponse = Marshallers.Create((arg) => arg.ToByteArray(), global::grpc.testing.StreamingOutputCallResponse.ParseFrom); static readonly Marshaller<global::Grpc.Testing.StreamingOutputCallResponse> __Marshaller_StreamingOutputCallResponse = Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.StreamingOutputCallResponse.Parser.ParseFrom);
static readonly Marshaller<global::grpc.testing.StreamingInputCallRequest> __Marshaller_StreamingInputCallRequest = Marshallers.Create((arg) => arg.ToByteArray(), global::grpc.testing.StreamingInputCallRequest.ParseFrom); static readonly Marshaller<global::Grpc.Testing.StreamingInputCallRequest> __Marshaller_StreamingInputCallRequest = Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.StreamingInputCallRequest.Parser.ParseFrom);
static readonly Marshaller<global::grpc.testing.StreamingInputCallResponse> __Marshaller_StreamingInputCallResponse = Marshallers.Create((arg) => arg.ToByteArray(), global::grpc.testing.StreamingInputCallResponse.ParseFrom); static readonly Marshaller<global::Grpc.Testing.StreamingInputCallResponse> __Marshaller_StreamingInputCallResponse = Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.StreamingInputCallResponse.Parser.ParseFrom);
static readonly Method<global::grpc.testing.Empty, global::grpc.testing.Empty> __Method_EmptyCall = new Method<global::grpc.testing.Empty, global::grpc.testing.Empty>( static readonly Method<global::Grpc.Testing.Empty, global::Grpc.Testing.Empty> __Method_EmptyCall = new Method<global::Grpc.Testing.Empty, global::Grpc.Testing.Empty>(
MethodType.Unary, MethodType.Unary,
__ServiceName, __ServiceName,
"EmptyCall", "EmptyCall",
__Marshaller_Empty, __Marshaller_Empty,
__Marshaller_Empty); __Marshaller_Empty);
static readonly Method<global::grpc.testing.SimpleRequest, global::grpc.testing.SimpleResponse> __Method_UnaryCall = new Method<global::grpc.testing.SimpleRequest, global::grpc.testing.SimpleResponse>( static readonly Method<global::Grpc.Testing.SimpleRequest, global::Grpc.Testing.SimpleResponse> __Method_UnaryCall = new Method<global::Grpc.Testing.SimpleRequest, global::Grpc.Testing.SimpleResponse>(
MethodType.Unary, MethodType.Unary,
__ServiceName, __ServiceName,
"UnaryCall", "UnaryCall",
__Marshaller_SimpleRequest, __Marshaller_SimpleRequest,
__Marshaller_SimpleResponse); __Marshaller_SimpleResponse);
static readonly Method<global::grpc.testing.StreamingOutputCallRequest, global::grpc.testing.StreamingOutputCallResponse> __Method_StreamingOutputCall = new Method<global::grpc.testing.StreamingOutputCallRequest, global::grpc.testing.StreamingOutputCallResponse>( static readonly Method<global::Grpc.Testing.StreamingOutputCallRequest, global::Grpc.Testing.StreamingOutputCallResponse> __Method_StreamingOutputCall = new Method<global::Grpc.Testing.StreamingOutputCallRequest, global::Grpc.Testing.StreamingOutputCallResponse>(
MethodType.ServerStreaming, MethodType.ServerStreaming,
__ServiceName, __ServiceName,
"StreamingOutputCall", "StreamingOutputCall",
__Marshaller_StreamingOutputCallRequest, __Marshaller_StreamingOutputCallRequest,
__Marshaller_StreamingOutputCallResponse); __Marshaller_StreamingOutputCallResponse);
static readonly Method<global::grpc.testing.StreamingInputCallRequest, global::grpc.testing.StreamingInputCallResponse> __Method_StreamingInputCall = new Method<global::grpc.testing.StreamingInputCallRequest, global::grpc.testing.StreamingInputCallResponse>( static readonly Method<global::Grpc.Testing.StreamingInputCallRequest, global::Grpc.Testing.StreamingInputCallResponse> __Method_StreamingInputCall = new Method<global::Grpc.Testing.StreamingInputCallRequest, global::Grpc.Testing.StreamingInputCallResponse>(
MethodType.ClientStreaming, MethodType.ClientStreaming,
__ServiceName, __ServiceName,
"StreamingInputCall", "StreamingInputCall",
__Marshaller_StreamingInputCallRequest, __Marshaller_StreamingInputCallRequest,
__Marshaller_StreamingInputCallResponse); __Marshaller_StreamingInputCallResponse);
static readonly Method<global::grpc.testing.StreamingOutputCallRequest, global::grpc.testing.StreamingOutputCallResponse> __Method_FullDuplexCall = new Method<global::grpc.testing.StreamingOutputCallRequest, global::grpc.testing.StreamingOutputCallResponse>( static readonly Method<global::Grpc.Testing.StreamingOutputCallRequest, global::Grpc.Testing.StreamingOutputCallResponse> __Method_FullDuplexCall = new Method<global::Grpc.Testing.StreamingOutputCallRequest, global::Grpc.Testing.StreamingOutputCallResponse>(
MethodType.DuplexStreaming, MethodType.DuplexStreaming,
__ServiceName, __ServiceName,
"FullDuplexCall", "FullDuplexCall",
__Marshaller_StreamingOutputCallRequest, __Marshaller_StreamingOutputCallRequest,
__Marshaller_StreamingOutputCallResponse); __Marshaller_StreamingOutputCallResponse);
static readonly Method<global::grpc.testing.StreamingOutputCallRequest, global::grpc.testing.StreamingOutputCallResponse> __Method_HalfDuplexCall = new Method<global::grpc.testing.StreamingOutputCallRequest, global::grpc.testing.StreamingOutputCallResponse>( static readonly Method<global::Grpc.Testing.StreamingOutputCallRequest, global::Grpc.Testing.StreamingOutputCallResponse> __Method_HalfDuplexCall = new Method<global::Grpc.Testing.StreamingOutputCallRequest, global::Grpc.Testing.StreamingOutputCallResponse>(
MethodType.DuplexStreaming, MethodType.DuplexStreaming,
__ServiceName, __ServiceName,
"HalfDuplexCall", "HalfDuplexCall",
__Marshaller_StreamingOutputCallRequest, __Marshaller_StreamingOutputCallRequest,
__Marshaller_StreamingOutputCallResponse); __Marshaller_StreamingOutputCallResponse);
// service descriptor
public static global::Google.Protobuf.Reflection.ServiceDescriptor Descriptor
{
get { return global::Grpc.Testing.Test.Descriptor.Services[0]; }
}
// client interface // client interface
public interface ITestServiceClient public interface ITestServiceClient
{ {
global::grpc.testing.Empty EmptyCall(global::grpc.testing.Empty request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)); global::Grpc.Testing.Empty EmptyCall(global::Grpc.Testing.Empty request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken));
global::grpc.testing.Empty EmptyCall(global::grpc.testing.Empty request, CallOptions options); global::Grpc.Testing.Empty EmptyCall(global::Grpc.Testing.Empty request, CallOptions options);
AsyncUnaryCall<global::grpc.testing.Empty> EmptyCallAsync(global::grpc.testing.Empty request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)); AsyncUnaryCall<global::Grpc.Testing.Empty> EmptyCallAsync(global::Grpc.Testing.Empty request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken));
AsyncUnaryCall<global::grpc.testing.Empty> EmptyCallAsync(global::grpc.testing.Empty request, CallOptions options); AsyncUnaryCall<global::Grpc.Testing.Empty> EmptyCallAsync(global::Grpc.Testing.Empty request, CallOptions options);
global::grpc.testing.SimpleResponse UnaryCall(global::grpc.testing.SimpleRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)); global::Grpc.Testing.SimpleResponse UnaryCall(global::Grpc.Testing.SimpleRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken));
global::grpc.testing.SimpleResponse UnaryCall(global::grpc.testing.SimpleRequest request, CallOptions options); global::Grpc.Testing.SimpleResponse UnaryCall(global::Grpc.Testing.SimpleRequest request, CallOptions options);
AsyncUnaryCall<global::grpc.testing.SimpleResponse> UnaryCallAsync(global::grpc.testing.SimpleRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)); AsyncUnaryCall<global::Grpc.Testing.SimpleResponse> UnaryCallAsync(global::Grpc.Testing.SimpleRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken));
AsyncUnaryCall<global::grpc.testing.SimpleResponse> UnaryCallAsync(global::grpc.testing.SimpleRequest request, CallOptions options); AsyncUnaryCall<global::Grpc.Testing.SimpleResponse> UnaryCallAsync(global::Grpc.Testing.SimpleRequest request, CallOptions options);
AsyncServerStreamingCall<global::grpc.testing.StreamingOutputCallResponse> StreamingOutputCall(global::grpc.testing.StreamingOutputCallRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)); AsyncServerStreamingCall<global::Grpc.Testing.StreamingOutputCallResponse> StreamingOutputCall(global::Grpc.Testing.StreamingOutputCallRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken));
AsyncServerStreamingCall<global::grpc.testing.StreamingOutputCallResponse> StreamingOutputCall(global::grpc.testing.StreamingOutputCallRequest request, CallOptions options); AsyncServerStreamingCall<global::Grpc.Testing.StreamingOutputCallResponse> StreamingOutputCall(global::Grpc.Testing.StreamingOutputCallRequest request, CallOptions options);
AsyncClientStreamingCall<global::grpc.testing.StreamingInputCallRequest, global::grpc.testing.StreamingInputCallResponse> StreamingInputCall(Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)); AsyncClientStreamingCall<global::Grpc.Testing.StreamingInputCallRequest, global::Grpc.Testing.StreamingInputCallResponse> StreamingInputCall(Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken));
AsyncClientStreamingCall<global::grpc.testing.StreamingInputCallRequest, global::grpc.testing.StreamingInputCallResponse> StreamingInputCall(CallOptions options); AsyncClientStreamingCall<global::Grpc.Testing.StreamingInputCallRequest, global::Grpc.Testing.StreamingInputCallResponse> StreamingInputCall(CallOptions options);
AsyncDuplexStreamingCall<global::grpc.testing.StreamingOutputCallRequest, global::grpc.testing.StreamingOutputCallResponse> FullDuplexCall(Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)); AsyncDuplexStreamingCall<global::Grpc.Testing.StreamingOutputCallRequest, global::Grpc.Testing.StreamingOutputCallResponse> FullDuplexCall(Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken));
AsyncDuplexStreamingCall<global::grpc.testing.StreamingOutputCallRequest, global::grpc.testing.StreamingOutputCallResponse> FullDuplexCall(CallOptions options); AsyncDuplexStreamingCall<global::Grpc.Testing.StreamingOutputCallRequest, global::Grpc.Testing.StreamingOutputCallResponse> FullDuplexCall(CallOptions options);
AsyncDuplexStreamingCall<global::grpc.testing.StreamingOutputCallRequest, global::grpc.testing.StreamingOutputCallResponse> HalfDuplexCall(Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)); AsyncDuplexStreamingCall<global::Grpc.Testing.StreamingOutputCallRequest, global::Grpc.Testing.StreamingOutputCallResponse> HalfDuplexCall(Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken));
AsyncDuplexStreamingCall<global::grpc.testing.StreamingOutputCallRequest, global::grpc.testing.StreamingOutputCallResponse> HalfDuplexCall(CallOptions options); AsyncDuplexStreamingCall<global::Grpc.Testing.StreamingOutputCallRequest, global::Grpc.Testing.StreamingOutputCallResponse> HalfDuplexCall(CallOptions options);
} }
// server-side interface // server-side interface
public interface ITestService public interface ITestService
{ {
Task<global::grpc.testing.Empty> EmptyCall(global::grpc.testing.Empty request, ServerCallContext context); Task<global::Grpc.Testing.Empty> EmptyCall(global::Grpc.Testing.Empty request, ServerCallContext context);
Task<global::grpc.testing.SimpleResponse> UnaryCall(global::grpc.testing.SimpleRequest request, ServerCallContext context); Task<global::Grpc.Testing.SimpleResponse> UnaryCall(global::Grpc.Testing.SimpleRequest request, ServerCallContext context);
Task StreamingOutputCall(global::grpc.testing.StreamingOutputCallRequest request, IServerStreamWriter<global::grpc.testing.StreamingOutputCallResponse> responseStream, ServerCallContext context); Task StreamingOutputCall(global::Grpc.Testing.StreamingOutputCallRequest request, IServerStreamWriter<global::Grpc.Testing.StreamingOutputCallResponse> responseStream, ServerCallContext context);
Task<global::grpc.testing.StreamingInputCallResponse> StreamingInputCall(IAsyncStreamReader<global::grpc.testing.StreamingInputCallRequest> requestStream, ServerCallContext context); Task<global::Grpc.Testing.StreamingInputCallResponse> StreamingInputCall(IAsyncStreamReader<global::Grpc.Testing.StreamingInputCallRequest> requestStream, ServerCallContext context);
Task FullDuplexCall(IAsyncStreamReader<global::grpc.testing.StreamingOutputCallRequest> requestStream, IServerStreamWriter<global::grpc.testing.StreamingOutputCallResponse> responseStream, ServerCallContext context); Task FullDuplexCall(IAsyncStreamReader<global::Grpc.Testing.StreamingOutputCallRequest> requestStream, IServerStreamWriter<global::Grpc.Testing.StreamingOutputCallResponse> responseStream, ServerCallContext context);
Task HalfDuplexCall(IAsyncStreamReader<global::grpc.testing.StreamingOutputCallRequest> requestStream, IServerStreamWriter<global::grpc.testing.StreamingOutputCallResponse> responseStream, ServerCallContext context); Task HalfDuplexCall(IAsyncStreamReader<global::Grpc.Testing.StreamingOutputCallRequest> requestStream, IServerStreamWriter<global::Grpc.Testing.StreamingOutputCallResponse> responseStream, ServerCallContext context);
} }
// client stub // client stub
@ -100,82 +106,82 @@ namespace grpc.testing {
public TestServiceClient(Channel channel) : base(channel) public TestServiceClient(Channel channel) : base(channel)
{ {
} }
public global::grpc.testing.Empty EmptyCall(global::grpc.testing.Empty request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) public global::Grpc.Testing.Empty EmptyCall(global::Grpc.Testing.Empty request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken))
{ {
var call = CreateCall(__Method_EmptyCall, new CallOptions(headers, deadline, cancellationToken)); var call = CreateCall(__Method_EmptyCall, new CallOptions(headers, deadline, cancellationToken));
return Calls.BlockingUnaryCall(call, request); return Calls.BlockingUnaryCall(call, request);
} }
public global::grpc.testing.Empty EmptyCall(global::grpc.testing.Empty request, CallOptions options) public global::Grpc.Testing.Empty EmptyCall(global::Grpc.Testing.Empty request, CallOptions options)
{ {
var call = CreateCall(__Method_EmptyCall, options); var call = CreateCall(__Method_EmptyCall, options);
return Calls.BlockingUnaryCall(call, request); return Calls.BlockingUnaryCall(call, request);
} }
public AsyncUnaryCall<global::grpc.testing.Empty> EmptyCallAsync(global::grpc.testing.Empty request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) public AsyncUnaryCall<global::Grpc.Testing.Empty> EmptyCallAsync(global::Grpc.Testing.Empty request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken))
{ {
var call = CreateCall(__Method_EmptyCall, new CallOptions(headers, deadline, cancellationToken)); var call = CreateCall(__Method_EmptyCall, new CallOptions(headers, deadline, cancellationToken));
return Calls.AsyncUnaryCall(call, request); return Calls.AsyncUnaryCall(call, request);
} }
public AsyncUnaryCall<global::grpc.testing.Empty> EmptyCallAsync(global::grpc.testing.Empty request, CallOptions options) public AsyncUnaryCall<global::Grpc.Testing.Empty> EmptyCallAsync(global::Grpc.Testing.Empty request, CallOptions options)
{ {
var call = CreateCall(__Method_EmptyCall, options); var call = CreateCall(__Method_EmptyCall, options);
return Calls.AsyncUnaryCall(call, request); return Calls.AsyncUnaryCall(call, request);
} }
public global::grpc.testing.SimpleResponse UnaryCall(global::grpc.testing.SimpleRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) public global::Grpc.Testing.SimpleResponse UnaryCall(global::Grpc.Testing.SimpleRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken))
{ {
var call = CreateCall(__Method_UnaryCall, new CallOptions(headers, deadline, cancellationToken)); var call = CreateCall(__Method_UnaryCall, new CallOptions(headers, deadline, cancellationToken));
return Calls.BlockingUnaryCall(call, request); return Calls.BlockingUnaryCall(call, request);
} }
public global::grpc.testing.SimpleResponse UnaryCall(global::grpc.testing.SimpleRequest request, CallOptions options) public global::Grpc.Testing.SimpleResponse UnaryCall(global::Grpc.Testing.SimpleRequest request, CallOptions options)
{ {
var call = CreateCall(__Method_UnaryCall, options); var call = CreateCall(__Method_UnaryCall, options);
return Calls.BlockingUnaryCall(call, request); return Calls.BlockingUnaryCall(call, request);
} }
public AsyncUnaryCall<global::grpc.testing.SimpleResponse> UnaryCallAsync(global::grpc.testing.SimpleRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) public AsyncUnaryCall<global::Grpc.Testing.SimpleResponse> UnaryCallAsync(global::Grpc.Testing.SimpleRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken))
{ {
var call = CreateCall(__Method_UnaryCall, new CallOptions(headers, deadline, cancellationToken)); var call = CreateCall(__Method_UnaryCall, new CallOptions(headers, deadline, cancellationToken));
return Calls.AsyncUnaryCall(call, request); return Calls.AsyncUnaryCall(call, request);
} }
public AsyncUnaryCall<global::grpc.testing.SimpleResponse> UnaryCallAsync(global::grpc.testing.SimpleRequest request, CallOptions options) public AsyncUnaryCall<global::Grpc.Testing.SimpleResponse> UnaryCallAsync(global::Grpc.Testing.SimpleRequest request, CallOptions options)
{ {
var call = CreateCall(__Method_UnaryCall, options); var call = CreateCall(__Method_UnaryCall, options);
return Calls.AsyncUnaryCall(call, request); return Calls.AsyncUnaryCall(call, request);
} }
public AsyncServerStreamingCall<global::grpc.testing.StreamingOutputCallResponse> StreamingOutputCall(global::grpc.testing.StreamingOutputCallRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) public AsyncServerStreamingCall<global::Grpc.Testing.StreamingOutputCallResponse> StreamingOutputCall(global::Grpc.Testing.StreamingOutputCallRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken))
{ {
var call = CreateCall(__Method_StreamingOutputCall, new CallOptions(headers, deadline, cancellationToken)); var call = CreateCall(__Method_StreamingOutputCall, new CallOptions(headers, deadline, cancellationToken));
return Calls.AsyncServerStreamingCall(call, request); return Calls.AsyncServerStreamingCall(call, request);
} }
public AsyncServerStreamingCall<global::grpc.testing.StreamingOutputCallResponse> StreamingOutputCall(global::grpc.testing.StreamingOutputCallRequest request, CallOptions options) public AsyncServerStreamingCall<global::Grpc.Testing.StreamingOutputCallResponse> StreamingOutputCall(global::Grpc.Testing.StreamingOutputCallRequest request, CallOptions options)
{ {
var call = CreateCall(__Method_StreamingOutputCall, options); var call = CreateCall(__Method_StreamingOutputCall, options);
return Calls.AsyncServerStreamingCall(call, request); return Calls.AsyncServerStreamingCall(call, request);
} }
public AsyncClientStreamingCall<global::grpc.testing.StreamingInputCallRequest, global::grpc.testing.StreamingInputCallResponse> StreamingInputCall(Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) public AsyncClientStreamingCall<global::Grpc.Testing.StreamingInputCallRequest, global::Grpc.Testing.StreamingInputCallResponse> StreamingInputCall(Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken))
{ {
var call = CreateCall(__Method_StreamingInputCall, new CallOptions(headers, deadline, cancellationToken)); var call = CreateCall(__Method_StreamingInputCall, new CallOptions(headers, deadline, cancellationToken));
return Calls.AsyncClientStreamingCall(call); return Calls.AsyncClientStreamingCall(call);
} }
public AsyncClientStreamingCall<global::grpc.testing.StreamingInputCallRequest, global::grpc.testing.StreamingInputCallResponse> StreamingInputCall(CallOptions options) public AsyncClientStreamingCall<global::Grpc.Testing.StreamingInputCallRequest, global::Grpc.Testing.StreamingInputCallResponse> StreamingInputCall(CallOptions options)
{ {
var call = CreateCall(__Method_StreamingInputCall, options); var call = CreateCall(__Method_StreamingInputCall, options);
return Calls.AsyncClientStreamingCall(call); return Calls.AsyncClientStreamingCall(call);
} }
public AsyncDuplexStreamingCall<global::grpc.testing.StreamingOutputCallRequest, global::grpc.testing.StreamingOutputCallResponse> FullDuplexCall(Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) public AsyncDuplexStreamingCall<global::Grpc.Testing.StreamingOutputCallRequest, global::Grpc.Testing.StreamingOutputCallResponse> FullDuplexCall(Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken))
{ {
var call = CreateCall(__Method_FullDuplexCall, new CallOptions(headers, deadline, cancellationToken)); var call = CreateCall(__Method_FullDuplexCall, new CallOptions(headers, deadline, cancellationToken));
return Calls.AsyncDuplexStreamingCall(call); return Calls.AsyncDuplexStreamingCall(call);
} }
public AsyncDuplexStreamingCall<global::grpc.testing.StreamingOutputCallRequest, global::grpc.testing.StreamingOutputCallResponse> FullDuplexCall(CallOptions options) public AsyncDuplexStreamingCall<global::Grpc.Testing.StreamingOutputCallRequest, global::Grpc.Testing.StreamingOutputCallResponse> FullDuplexCall(CallOptions options)
{ {
var call = CreateCall(__Method_FullDuplexCall, options); var call = CreateCall(__Method_FullDuplexCall, options);
return Calls.AsyncDuplexStreamingCall(call); return Calls.AsyncDuplexStreamingCall(call);
} }
public AsyncDuplexStreamingCall<global::grpc.testing.StreamingOutputCallRequest, global::grpc.testing.StreamingOutputCallResponse> HalfDuplexCall(Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) public AsyncDuplexStreamingCall<global::Grpc.Testing.StreamingOutputCallRequest, global::Grpc.Testing.StreamingOutputCallResponse> HalfDuplexCall(Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken))
{ {
var call = CreateCall(__Method_HalfDuplexCall, new CallOptions(headers, deadline, cancellationToken)); var call = CreateCall(__Method_HalfDuplexCall, new CallOptions(headers, deadline, cancellationToken));
return Calls.AsyncDuplexStreamingCall(call); return Calls.AsyncDuplexStreamingCall(call);
} }
public AsyncDuplexStreamingCall<global::grpc.testing.StreamingOutputCallRequest, global::grpc.testing.StreamingOutputCallResponse> HalfDuplexCall(CallOptions options) public AsyncDuplexStreamingCall<global::Grpc.Testing.StreamingOutputCallRequest, global::Grpc.Testing.StreamingOutputCallResponse> HalfDuplexCall(CallOptions options)
{ {
var call = CreateCall(__Method_HalfDuplexCall, options); var call = CreateCall(__Method_HalfDuplexCall, options);
return Calls.AsyncDuplexStreamingCall(call); return Calls.AsyncDuplexStreamingCall(call);

@ -35,11 +35,11 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Threading; using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
using Google.ProtocolBuffers; using Google.Protobuf;
using Grpc.Core; using Grpc.Core;
using Grpc.Core.Utils; using Grpc.Core.Utils;
namespace grpc.testing namespace Grpc.Testing
{ {
/// <summary> /// <summary>
/// Implementation of TestService server /// Implementation of TestService server
@ -48,22 +48,20 @@ namespace grpc.testing
{ {
public Task<Empty> EmptyCall(Empty request, ServerCallContext context) public Task<Empty> EmptyCall(Empty request, ServerCallContext context)
{ {
return Task.FromResult(Empty.DefaultInstance); return Task.FromResult(new Empty());
} }
public Task<SimpleResponse> UnaryCall(SimpleRequest request, ServerCallContext context) public Task<SimpleResponse> UnaryCall(SimpleRequest request, ServerCallContext context)
{ {
var response = SimpleResponse.CreateBuilder() var response = new SimpleResponse { Payload = CreateZerosPayload(request.ResponseSize) };
.SetPayload(CreateZerosPayload(request.ResponseSize)).Build();
return Task.FromResult(response); return Task.FromResult(response);
} }
public async Task StreamingOutputCall(StreamingOutputCallRequest request, IServerStreamWriter<StreamingOutputCallResponse> responseStream, ServerCallContext context) public async Task StreamingOutputCall(StreamingOutputCallRequest request, IServerStreamWriter<StreamingOutputCallResponse> responseStream, ServerCallContext context)
{ {
foreach (var responseParam in request.ResponseParametersList) foreach (var responseParam in request.ResponseParameters)
{ {
var response = StreamingOutputCallResponse.CreateBuilder() var response = new StreamingOutputCallResponse { Payload = CreateZerosPayload(responseParam.Size) };
.SetPayload(CreateZerosPayload(responseParam.Size)).Build();
await responseStream.WriteAsync(response); await responseStream.WriteAsync(response);
} }
} }
@ -75,17 +73,16 @@ namespace grpc.testing
{ {
sum += request.Payload.Body.Length; sum += request.Payload.Body.Length;
}); });
return StreamingInputCallResponse.CreateBuilder().SetAggregatedPayloadSize(sum).Build(); return new StreamingInputCallResponse { AggregatedPayloadSize = sum };
} }
public async Task FullDuplexCall(IAsyncStreamReader<StreamingOutputCallRequest> requestStream, IServerStreamWriter<StreamingOutputCallResponse> responseStream, ServerCallContext context) public async Task FullDuplexCall(IAsyncStreamReader<StreamingOutputCallRequest> requestStream, IServerStreamWriter<StreamingOutputCallResponse> responseStream, ServerCallContext context)
{ {
await requestStream.ForEachAsync(async request => await requestStream.ForEachAsync(async request =>
{ {
foreach (var responseParam in request.ResponseParametersList) foreach (var responseParam in request.ResponseParameters)
{ {
var response = StreamingOutputCallResponse.CreateBuilder() var response = new StreamingOutputCallResponse { Payload = CreateZerosPayload(responseParam.Size) };
.SetPayload(CreateZerosPayload(responseParam.Size)).Build();
await responseStream.WriteAsync(response); await responseStream.WriteAsync(response);
} }
}); });
@ -98,7 +95,7 @@ namespace grpc.testing
private static Payload CreateZerosPayload(int size) private static Payload CreateZerosPayload(int size)
{ {
return Payload.CreateBuilder().SetBody(ByteString.CopyFrom(new byte[size])).Build(); return new Payload { Body = ByteString.CopyFrom(new byte[size]) };
} }
} }
} }

@ -3,6 +3,7 @@
<package id="BouncyCastle" version="1.7.0" targetFramework="net45" /> <package id="BouncyCastle" version="1.7.0" targetFramework="net45" />
<package id="Google.Apis.Auth" version="1.9.3" targetFramework="net45" /> <package id="Google.Apis.Auth" version="1.9.3" targetFramework="net45" />
<package id="Google.Apis.Core" version="1.9.3" targetFramework="net45" /> <package id="Google.Apis.Core" version="1.9.3" targetFramework="net45" />
<package id="Google.Protobuf" version="3.0.0-alpha4" targetFramework="net45" />
<package id="Google.ProtocolBuffers" version="2.4.1.521" targetFramework="net45" /> <package id="Google.ProtocolBuffers" version="2.4.1.521" targetFramework="net45" />
<package id="Ix-Async" version="1.2.3" targetFramework="net45" /> <package id="Ix-Async" version="1.2.3" targetFramework="net45" />
<package id="Microsoft.Bcl" version="1.1.10" targetFramework="net45" /> <package id="Microsoft.Bcl" version="1.1.10" targetFramework="net45" />

@ -28,7 +28,7 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
syntax = "proto2"; syntax = "proto3";
package grpc.testing; package grpc.testing;

@ -30,7 +30,7 @@
// Message definitions to be used by integration test service definitions. // Message definitions to be used by integration test service definitions.
syntax = "proto2"; syntax = "proto3";
package grpc.testing; package grpc.testing;
@ -49,46 +49,46 @@ enum PayloadType {
// A block of data, to simply increase gRPC message size. // A block of data, to simply increase gRPC message size.
message Payload { message Payload {
// The type of data in body. // The type of data in body.
optional PayloadType type = 1; PayloadType type = 1;
// Primary contents of payload. // Primary contents of payload.
optional bytes body = 2; bytes body = 2;
} }
// Unary request. // Unary request.
message SimpleRequest { message SimpleRequest {
// Desired payload type in the response from the server. // Desired payload type in the response from the server.
// If response_type is RANDOM, server randomly chooses one from other formats. // If response_type is RANDOM, server randomly chooses one from other formats.
optional PayloadType response_type = 1; PayloadType response_type = 1;
// Desired payload size in the response from the server. // Desired payload size in the response from the server.
// If response_type is COMPRESSABLE, this denotes the size before compression. // If response_type is COMPRESSABLE, this denotes the size before compression.
optional int32 response_size = 2; int32 response_size = 2;
// Optional input payload sent along with the request. // Optional input payload sent along with the request.
optional Payload payload = 3; Payload payload = 3;
// Whether SimpleResponse should include username. // Whether SimpleResponse should include username.
optional bool fill_username = 4; bool fill_username = 4;
// Whether SimpleResponse should include OAuth scope. // Whether SimpleResponse should include OAuth scope.
optional bool fill_oauth_scope = 5; bool fill_oauth_scope = 5;
} }
// Unary response, as configured by the request. // Unary response, as configured by the request.
message SimpleResponse { message SimpleResponse {
// Payload to increase message size. // Payload to increase message size.
optional Payload payload = 1; Payload payload = 1;
// The user the request came from, for verifying authentication was // The user the request came from, for verifying authentication was
// successful when the client expected it. // successful when the client expected it.
optional string username = 2; string username = 2;
// OAuth scope. // OAuth scope.
optional string oauth_scope = 3; string oauth_scope = 3;
} }
// Client-streaming request. // Client-streaming request.
message StreamingInputCallRequest { message StreamingInputCallRequest {
// Optional input payload sent along with the request. // Optional input payload sent along with the request.
optional Payload payload = 1; Payload payload = 1;
// Not expecting any payload from the response. // Not expecting any payload from the response.
} }
@ -96,18 +96,18 @@ message StreamingInputCallRequest {
// Client-streaming response. // Client-streaming response.
message StreamingInputCallResponse { message StreamingInputCallResponse {
// Aggregated size of payloads received from the client. // Aggregated size of payloads received from the client.
optional int32 aggregated_payload_size = 1; int32 aggregated_payload_size = 1;
} }
// Configuration for a particular response. // Configuration for a particular response.
message ResponseParameters { message ResponseParameters {
// Desired payload sizes in responses from the server. // Desired payload sizes in responses from the server.
// If response_type is COMPRESSABLE, this denotes the size before compression. // If response_type is COMPRESSABLE, this denotes the size before compression.
optional int32 size = 1; int32 size = 1;
// Desired interval between consecutive responses in the response stream in // Desired interval between consecutive responses in the response stream in
// microseconds. // microseconds.
optional int32 interval_us = 2; int32 interval_us = 2;
} }
// Server-streaming request. // Server-streaming request.
@ -116,17 +116,17 @@ message StreamingOutputCallRequest {
// If response_type is RANDOM, the payload from each response in the stream // If response_type is RANDOM, the payload from each response in the stream
// might be of different types. This is to simulate a mixed type of payload // might be of different types. This is to simulate a mixed type of payload
// stream. // stream.
optional PayloadType response_type = 1; PayloadType response_type = 1;
// Configuration for each expected response message. // Configuration for each expected response message.
repeated ResponseParameters response_parameters = 2; repeated ResponseParameters response_parameters = 2;
// Optional input payload sent along with the request. // Optional input payload sent along with the request.
optional Payload payload = 3; Payload payload = 3;
} }
// Server-streaming response, as configured by the request and parameters. // Server-streaming response, as configured by the request and parameters.
message StreamingOutputCallResponse { message StreamingOutputCallResponse {
// Payload to increase response size. // Payload to increase response size.
optional Payload payload = 1; Payload payload = 1;
} }

@ -30,7 +30,7 @@
// An integration test service that covers all the method signature permutations // An integration test service that covers all the method signature permutations
// of unary/streaming requests/responses. // of unary/streaming requests/responses.
syntax = "proto2"; syntax = "proto3";
import "empty.proto"; import "empty.proto";
import "messages.proto"; import "messages.proto";

@ -4,19 +4,18 @@
<id>Grpc.Tools</id> <id>Grpc.Tools</id>
<title>gRPC C# Tools</title> <title>gRPC C# Tools</title>
<summary>Tools for C# implementation of gRPC - an RPC library and framework</summary> <summary>Tools for C# implementation of gRPC - an RPC library and framework</summary>
<description>Precompiled Windows binaries for generating protocol buffer messages and gRPC client/server code</description> <description>Precompiled Windows binary for generating gRPC client/server code</description>
<version>$version$</version> <version>$version$</version>
<authors>Google Inc.</authors> <authors>Google Inc.</authors>
<owners>grpc-packages</owners> <owners>grpc-packages</owners>
<licenseUrl>https://github.com/grpc/grpc/blob/master/LICENSE</licenseUrl> <licenseUrl>https://github.com/grpc/grpc/blob/master/LICENSE</licenseUrl>
<projectUrl>https://github.com/grpc/grpc</projectUrl> <projectUrl>https://github.com/grpc/grpc</projectUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance> <requireLicenseAcceptance>false</requireLicenseAcceptance>
<releaseNotes>protoc.exe - protocol buffer compiler v3.0.0-alpha-3; grpc_csharp_plugin.exe - gRPC C# protoc plugin version $version$</releaseNotes> <releaseNotes>grpc_csharp_plugin.exe - gRPC C# protoc plugin version $version$</releaseNotes>
<copyright>Copyright 2015, Google Inc.</copyright> <copyright>Copyright 2015, Google Inc.</copyright>
<tags>gRPC RPC Protocol HTTP/2</tags> <tags>gRPC RPC Protocol HTTP/2</tags>
</metadata> </metadata>
<files> <files>
<file src="protoc.exe" target="tools" /> <file src="..\..\vsprojects\Release\grpc_csharp_plugin.exe" target="tools" />
<file src="grpc_csharp_plugin.exe" target="tools" />
</files> </files>
</package> </package>

@ -1,8 +1,9 @@
@rem Builds gRPC NuGet packages @rem Builds gRPC NuGet packages
@rem Current package versions @rem Current package versions
set VERSION=0.6.1 set VERSION=0.7.0
set CORE_VERSION=0.10.1 set CORE_VERSION=0.11.0
set PROTOBUF_VERSION=3.0.0-alpha4
@rem Adjust the location of nuget.exe @rem Adjust the location of nuget.exe
set NUGET=C:\nuget\nuget.exe set NUGET=C:\nuget\nuget.exe
@ -14,10 +15,12 @@ endlocal
@call buildall.bat BUILD_SIGNED || goto :error @call buildall.bat BUILD_SIGNED || goto :error
@call ..\..\vsprojects\build_plugins.bat || goto :error
%NUGET% pack ..\..\vsprojects\nuget_package\grpc.native.csharp_ext.nuspec -Version %CORE_VERSION% || goto :error %NUGET% pack ..\..\vsprojects\nuget_package\grpc.native.csharp_ext.nuspec -Version %CORE_VERSION% || goto :error
%NUGET% pack Grpc.Auth\Grpc.Auth.nuspec -Symbols -Version %VERSION% || goto :error %NUGET% pack Grpc.Auth\Grpc.Auth.nuspec -Symbols -Version %VERSION% || goto :error
%NUGET% pack Grpc.Core\Grpc.Core.nuspec -Symbols -Version %VERSION% -Properties GrpcNativeCsharpExtVersion=%CORE_VERSION% || goto :error %NUGET% pack Grpc.Core\Grpc.Core.nuspec -Symbols -Version %VERSION% -Properties GrpcNativeCsharpExtVersion=%CORE_VERSION% || goto :error
%NUGET% pack Grpc.HealthCheck\Grpc.HealthCheck.nuspec -Symbols -Version %VERSION% || goto :error %NUGET% pack Grpc.HealthCheck\Grpc.HealthCheck.nuspec -Symbols -Version %VERSION% -Properties ProtobufVersion=%PROTOBUF_VERSION% || goto :error
%NUGET% pack Grpc.Tools.nuspec -Version %VERSION% || goto :error %NUGET% pack Grpc.Tools.nuspec -Version %VERSION% || goto :error
%NUGET% pack Grpc.nuspec -Version %VERSION% || goto :error %NUGET% pack Grpc.nuspec -Version %VERSION% || goto :error

@ -38,11 +38,11 @@ EXAMPLES_DIR=Grpc.Examples
INTEROP_DIR=Grpc.IntegrationTesting INTEROP_DIR=Grpc.IntegrationTesting
HEALTHCHECK_DIR=Grpc.HealthCheck HEALTHCHECK_DIR=Grpc.HealthCheck
$PROTOC --plugin=$PLUGIN --grpc_out=$EXAMPLES_DIR \ $PROTOC --plugin=$PLUGIN --csharp_out=$EXAMPLES_DIR --grpc_out=$EXAMPLES_DIR \
-I $EXAMPLES_DIR/proto $EXAMPLES_DIR/proto/math.proto -I $EXAMPLES_DIR/proto $EXAMPLES_DIR/proto/math.proto
$PROTOC --plugin=$PLUGIN --grpc_out=$INTEROP_DIR \ $PROTOC --plugin=$PLUGIN --csharp_out=$INTEROP_DIR --grpc_out=$INTEROP_DIR \
-I $INTEROP_DIR/proto $INTEROP_DIR/proto/test.proto -I $INTEROP_DIR/proto $INTEROP_DIR/proto/*.proto
$PROTOC --plugin=$PLUGIN --grpc_out=$HEALTHCHECK_DIR \ $PROTOC --plugin=$PLUGIN --csharp_out=$HEALTHCHECK_DIR --grpc_out=$HEALTHCHECK_DIR \
-I $HEALTHCHECK_DIR/proto $HEALTHCHECK_DIR/proto/health.proto -I $HEALTHCHECK_DIR/proto $HEALTHCHECK_DIR/proto/health.proto

@ -23,7 +23,7 @@
props.extend(['cpptest']) props.extend(['cpptest'])
if configuration_type == 'Application': if configuration_type == 'Application':
if target.build == 'protoc': if target.build == 'protoc':
props.extend(['protoc']) props.extend(['protoc', 'protobuf'])
else: else:
props.extend(['winsock', 'protobuf', 'zlib', 'openssl']) props.extend(['winsock', 'protobuf', 'zlib', 'openssl'])
else: else:

@ -1 +1 @@
Subproject commit 3e2c8a5dd79481e1d36572cdf65be93514ba6581 Subproject commit 23408684b4d2bf1b25e14314413a14d542c18bc4

@ -46,7 +46,7 @@ diff -u $submodules - << EOF
05b155ff59114735ec8cd089f669c4c3d8f59029 third_party/gflags (v2.1.0-45-g05b155f) 05b155ff59114735ec8cd089f669c4c3d8f59029 third_party/gflags (v2.1.0-45-g05b155f)
c99458533a9b4c743ed51537e25989ea55944908 third_party/googletest (release-1.7.0) c99458533a9b4c743ed51537e25989ea55944908 third_party/googletest (release-1.7.0)
33dd08320648ac71d7d9d732be774ed3818dccc5 third_party/openssl (OpenSSL_1_0_2d) 33dd08320648ac71d7d9d732be774ed3818dccc5 third_party/openssl (OpenSSL_1_0_2d)
3e2c8a5dd79481e1d36572cdf65be93514ba6581 third_party/protobuf (v3.0.0-alpha-1-1048-g3e2c8a5) 23408684b4d2bf1b25e14314413a14d542c18bc4 third_party/protobuf (v3.0.0-alpha-1-1592-g2340868)
50893291621658f355bc5b4d450a8d06a563053d third_party/zlib (v1.2.8) 50893291621658f355bc5b4d450a8d06a563053d third_party/zlib (v1.2.8)
EOF EOF

@ -80,7 +80,12 @@ Individual tests can be run by directly running the executable in `/vsprojects/r
For generating service stub code, gRPC relies on plugins for `protoc` (the protocol buffer compiler). The solution `grpc_protoc_plugins.sln` allows you to build For generating service stub code, gRPC relies on plugins for `protoc` (the protocol buffer compiler). The solution `grpc_protoc_plugins.sln` allows you to build
Windows .exe binaries of gRPC protoc plugins. Windows .exe binaries of gRPC protoc plugins.
1. Open solution `third_party\protobuf\vsprojects\protobuf.sln` 1. Follow instructions in `third_party\protobuf\cmake\README.md` to create Visual Studio 2013 projects for protobuf.
2. Accept the conversion to newer Visual Studio version and ignore errors about gtest. ```
3. Build libprotoc in Release mode. $ cd third_party/protobuf/cmake
4. Open solution `vsprojects\grpc_protoc_plugins.sln` and build it in Release mode. As a result, you should obtain a set of gRPC protoc plugin binaries (`grpc_cpp_plugin.exe`, `grpc_csharp_plugin.exe`, ...) $ cmake -G "Visual Studio 12 2013"
```
2. Open solution `third_party\protobuf\cmake\protobuf.sln` and build it in Release mode. That will build libraries `libprotobuf.lib` and `libprotoc.lib` needed for the next step.
3. Open solution `vsprojects\grpc_protoc_plugins.sln` and build it in Release mode. As a result, you should obtain a set of gRPC protoc plugin binaries (`grpc_cpp_plugin.exe`, `grpc_csharp_plugin.exe`, ...)

@ -0,0 +1,23 @@
@rem Convenience script to build gRPC protoc plugins from command line. protoc plugins are used to generate service stub code from .proto service defintions.
setlocal
@rem enter this directory
cd /d %~dp0
@rem Set VS variables (uses Visual Studio 2013)
@call "%VS120COMNTOOLS%\..\..\vc\vcvarsall.bat" x86
@rem Build third_party/protobuf
msbuild ..\third_party\protobuf\cmake\protobuf.sln /p:Configuration=Release || goto :error
@rem Build the C# protoc plugins
msbuild grpc_protoc_plugins.sln /p:Configuration=Release || goto :error
endlocal
goto :EOF
:error
echo Failed!
exit /b %errorlevel%

@ -48,6 +48,7 @@
<ImportGroup Label="PropertySheets"> <ImportGroup Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\protoc.props" /> <Import Project="..\protoc.props" />
<Import Project="..\protobuf.props" />
<Import Project="..\global.props" /> <Import Project="..\global.props" />
</ImportGroup> </ImportGroup>
<PropertyGroup Label="UserMacros" /> <PropertyGroup Label="UserMacros" />

@ -48,6 +48,7 @@
<ImportGroup Label="PropertySheets"> <ImportGroup Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\protoc.props" /> <Import Project="..\protoc.props" />
<Import Project="..\protobuf.props" />
<Import Project="..\global.props" /> <Import Project="..\global.props" />
</ImportGroup> </ImportGroup>
<PropertyGroup Label="UserMacros" /> <PropertyGroup Label="UserMacros" />

@ -48,6 +48,7 @@
<ImportGroup Label="PropertySheets"> <ImportGroup Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\protoc.props" /> <Import Project="..\protoc.props" />
<Import Project="..\protobuf.props" />
<Import Project="..\global.props" /> <Import Project="..\global.props" />
</ImportGroup> </ImportGroup>
<PropertyGroup Label="UserMacros" /> <PropertyGroup Label="UserMacros" />

@ -48,6 +48,7 @@
<ImportGroup Label="PropertySheets"> <ImportGroup Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\protoc.props" /> <Import Project="..\protoc.props" />
<Import Project="..\protobuf.props" />
<Import Project="..\global.props" /> <Import Project="..\global.props" />
</ImportGroup> </ImportGroup>
<PropertyGroup Label="UserMacros" /> <PropertyGroup Label="UserMacros" />

@ -48,6 +48,7 @@
<ImportGroup Label="PropertySheets"> <ImportGroup Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\protoc.props" /> <Import Project="..\protoc.props" />
<Import Project="..\protobuf.props" />
<Import Project="..\global.props" /> <Import Project="..\global.props" />
</ImportGroup> </ImportGroup>
<PropertyGroup Label="UserMacros" /> <PropertyGroup Label="UserMacros" />

@ -6,7 +6,7 @@
<ItemDefinitionGroup> <ItemDefinitionGroup>
<Link> <Link>
<AdditionalDependencies>libprotobuf.lib;%(AdditionalDependencies)</AdditionalDependencies> <AdditionalDependencies>libprotobuf.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>$(ProjectDir)\..\..\third_party\protobuf\vsprojects\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories> <AdditionalLibraryDirectories>$(ProjectDir)\..\..\third_party\protobuf\cmake\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
</Link> </Link>
</ItemDefinitionGroup> </ItemDefinitionGroup>
<ItemGroup /> <ItemGroup />

@ -6,7 +6,7 @@
<ItemDefinitionGroup> <ItemDefinitionGroup>
<Link> <Link>
<AdditionalDependencies>libprotoc.lib;%(AdditionalDependencies)</AdditionalDependencies> <AdditionalDependencies>libprotoc.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>$(ProjectDir)\..\..\third_party\protobuf\vsprojects\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories> <AdditionalLibraryDirectories>$(ProjectDir)\..\..\third_party\protobuf\cmake\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
</Link> </Link>
</ItemDefinitionGroup> </ItemDefinitionGroup>
<ItemGroup /> <ItemGroup />

Loading…
Cancel
Save