Merge github.com:grpc/grpc into error

pull/6897/head
Craig Tiller 9 years ago
commit 2477c3cb89
  1. 2
      examples/csharp/helloworld/.nuget/packages.config
  2. 10
      examples/csharp/helloworld/Greeter/Greeter.csproj
  3. 144
      examples/csharp/helloworld/Greeter/HelloworldGrpc.cs
  4. 5
      examples/csharp/helloworld/Greeter/packages.config
  5. 10
      examples/csharp/helloworld/GreeterClient/GreeterClient.csproj
  6. 5
      examples/csharp/helloworld/GreeterClient/packages.config
  7. 10
      examples/csharp/helloworld/GreeterServer/GreeterServer.csproj
  8. 4
      examples/csharp/helloworld/GreeterServer/Program.cs
  9. 5
      examples/csharp/helloworld/GreeterServer/packages.config
  10. 2
      examples/csharp/helloworld/generate_protos.bat
  11. 2
      examples/csharp/route_guide/.nuget/packages.config
  12. 10
      examples/csharp/route_guide/RouteGuide/RouteGuide.csproj
  13. 368
      examples/csharp/route_guide/RouteGuide/RouteGuideGrpc.cs
  14. 5
      examples/csharp/route_guide/RouteGuide/packages.config
  15. 4
      examples/csharp/route_guide/RouteGuideClient/Program.cs
  16. 10
      examples/csharp/route_guide/RouteGuideClient/RouteGuideClient.csproj
  17. 5
      examples/csharp/route_guide/RouteGuideClient/packages.config
  18. 11
      examples/csharp/route_guide/RouteGuideServer/RouteGuideImpl.cs
  19. 10
      examples/csharp/route_guide/RouteGuideServer/RouteGuideServer.csproj
  20. 5
      examples/csharp/route_guide/RouteGuideServer/packages.config
  21. 2
      examples/csharp/route_guide/generate_protos.bat
  22. 38
      package.xml
  23. 2
      src/csharp/Grpc.Examples.Tests/Grpc.Examples.Tests.csproj
  24. 2
      src/csharp/Grpc.Examples.Tests/packages.config
  25. 2
      src/csharp/Grpc.Examples/Grpc.Examples.csproj
  26. 12
      src/csharp/Grpc.Examples/Math.cs
  27. 2
      src/csharp/Grpc.Examples/packages.config
  28. 2
      src/csharp/Grpc.HealthCheck.Tests/Grpc.HealthCheck.Tests.csproj
  29. 7
      src/csharp/Grpc.HealthCheck.Tests/HealthClientServerTest.cs
  30. 31
      src/csharp/Grpc.HealthCheck.Tests/HealthServiceImplTest.cs
  31. 2
      src/csharp/Grpc.HealthCheck.Tests/packages.config
  32. 2
      src/csharp/Grpc.HealthCheck/Grpc.HealthCheck.csproj
  33. 24
      src/csharp/Grpc.HealthCheck/Health.cs
  34. 2
      src/csharp/Grpc.HealthCheck/packages.config
  35. 14
      src/csharp/Grpc.IntegrationTesting/ClientRunners.cs
  36. 94
      src/csharp/Grpc.IntegrationTesting/Control.cs
  37. 4
      src/csharp/Grpc.IntegrationTesting/Empty.cs
  38. 2
      src/csharp/Grpc.IntegrationTesting/Grpc.IntegrationTesting.csproj
  39. 40
      src/csharp/Grpc.IntegrationTesting/InteropClient.cs
  40. 94
      src/csharp/Grpc.IntegrationTesting/Messages.cs
  41. 14
      src/csharp/Grpc.IntegrationTesting/Metrics.cs
  42. 10
      src/csharp/Grpc.IntegrationTesting/Payloads.cs
  43. 4
      src/csharp/Grpc.IntegrationTesting/RunnerClientServerTest.cs
  44. 4
      src/csharp/Grpc.IntegrationTesting/ServerRunners.cs
  45. 2
      src/csharp/Grpc.IntegrationTesting/Services.cs
  46. 10
      src/csharp/Grpc.IntegrationTesting/Stats.cs
  47. 2
      src/csharp/Grpc.IntegrationTesting/Test.cs
  48. 2
      src/csharp/Grpc.IntegrationTesting/packages.config
  49. 2
      src/csharp/build_packages.bat
  50. 50
      src/ruby/ext/grpc/rb_completion_queue.c
  51. 2
      src/ruby/ext/grpc/rb_completion_queue.h
  52. 2
      src/ruby/ext/grpc/rb_grpc.c
  53. 2
      src/ruby/ext/grpc/rb_server.c
  54. 70
      src/ruby/ext/grpc/rb_signal.c
  55. 39
      src/ruby/ext/grpc/rb_signal.h
  56. 3
      src/ruby/lib/grpc.rb
  57. 5
      src/ruby/lib/grpc/generic/active_call.rb
  58. 4
      src/ruby/lib/grpc/generic/rpc_server.rb
  59. 38
      templates/package.xml.template
  60. 2
      templates/src/csharp/build_packages.bat.template
  61. 16
      test/cpp/interop/metrics_client.cc
  62. 2
      third_party/protobuf
  63. 14
      tools/gcp/stress_test/run_client.py
  64. 10
      tools/gcp/stress_test/run_server.py
  65. 7
      tools/gcp/stress_test/stress_test_utils.py
  66. 2
      tools/run_tests/sanity/check_submodules.sh
  67. 7
      tools/run_tests/stress_test/configs/csharp.json
  68. 7
      tools/run_tests/stress_test/configs/java.json
  69. 66
      tools/run_tests/stress_test/print_summary.py

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<packages> <packages>
<package id="Grpc.Tools" version="0.13.1" /> <package id="Grpc.Tools" version="0.14.0" />
</packages> </packages>

@ -10,7 +10,7 @@
<RootNamespace>Greeter</RootNamespace> <RootNamespace>Greeter</RootNamespace>
<AssemblyName>Greeter</AssemblyName> <AssemblyName>Greeter</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion> <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<NuGetPackageImportStamp>96275748</NuGetPackageImportStamp> <NuGetPackageImportStamp>745ac60f</NuGetPackageImportStamp>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols> <DebugSymbols>true</DebugSymbols>
@ -35,9 +35,9 @@
<SpecificVersion>False</SpecificVersion> <SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\Google.Protobuf.3.0.0-beta2\lib\portable-net45+netcore45+wpa81+wp8\Google.Protobuf.dll</HintPath> <HintPath>..\packages\Google.Protobuf.3.0.0-beta2\lib\portable-net45+netcore45+wpa81+wp8\Google.Protobuf.dll</HintPath>
</Reference> </Reference>
<Reference Include="Grpc.Core, Version=0.13.1.0, Culture=neutral, PublicKeyToken=d754f35622e28bad, processorArchitecture=MSIL"> <Reference Include="Grpc.Core, Version=1.0.0.0, Culture=neutral, PublicKeyToken=d754f35622e28bad, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion> <SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\Grpc.Core.0.13.1\lib\net45\Grpc.Core.dll</HintPath> <HintPath>..\packages\Grpc.Core.0.14.0\lib\net45\Grpc.Core.dll</HintPath>
</Reference> </Reference>
<Reference Include="System" /> <Reference Include="System" />
<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">
@ -61,11 +61,11 @@
<None Include="packages.config" /> <None Include="packages.config" />
</ItemGroup> </ItemGroup>
<ItemGroup /> <ItemGroup />
<Import Project="..\packages\grpc.native.csharp.0.13.1\build\portable-net45+netcore45+wpa81+wp8\grpc.native.csharp.targets" Condition="Exists('..\packages\grpc.native.csharp.0.13.1\build\portable-net45+netcore45+wpa81+wp8\grpc.native.csharp.targets')" /> <Import Project="..\packages\Grpc.Core.0.14.0\build\net45\Grpc.Core.targets" Condition="Exists('..\packages\Grpc.Core.0.14.0\build\net45\Grpc.Core.targets')" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild"> <Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup> <PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText> <ErrorText>This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup> </PropertyGroup>
<Error Condition="!Exists('..\packages\grpc.native.csharp.0.13.1\build\portable-net45+netcore45+wpa81+wp8\grpc.native.csharp.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\grpc.native.csharp.0.13.1\build\portable-net45+netcore45+wpa81+wp8\grpc.native.csharp.targets'))" /> <Error Condition="!Exists('..\packages\Grpc.Core.0.14.0\build\net45\Grpc.Core.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Grpc.Core.0.14.0\build\net45\Grpc.Core.targets'))" />
</Target> </Target>
</Project> </Project>

@ -1,5 +1,35 @@
// Generated by the protocol buffer compiler. DO NOT EDIT! // Generated by the protocol buffer compiler. DO NOT EDIT!
// source: helloworld.proto // source: helloworld.proto
// Original file comments:
// Copyright 2015, Google Inc.
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the names of its
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
#region Designer generated code #region Designer generated code
using System; using System;
@ -8,6 +38,9 @@ using System.Threading.Tasks;
using Grpc.Core; using Grpc.Core;
namespace Helloworld { namespace Helloworld {
/// <summary>
/// The greeting service definition.
/// </summary>
public static class Greeter public static class Greeter
{ {
static readonly string __ServiceName = "helloworld.Greeter"; static readonly string __ServiceName = "helloworld.Greeter";
@ -22,66 +55,133 @@ namespace Helloworld {
__Marshaller_HelloRequest, __Marshaller_HelloRequest,
__Marshaller_HelloReply); __Marshaller_HelloReply);
// service descriptor /// <summary>Service descriptor</summary>
public static global::Google.Protobuf.Reflection.ServiceDescriptor Descriptor public static global::Google.Protobuf.Reflection.ServiceDescriptor Descriptor
{ {
get { return global::Helloworld.HelloworldReflection.Descriptor.Services[0]; } get { return global::Helloworld.HelloworldReflection.Descriptor.Services[0]; }
} }
// client interface /// <summary>Client for Greeter</summary>
[System.Obsolete("Client side interfaced will be removed in the next release. Use client class directly.")]
public interface IGreeterClient public interface IGreeterClient
{ {
/// <summary>
/// Sends a greeting
/// </summary>
global::Helloworld.HelloReply SayHello(global::Helloworld.HelloRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)); global::Helloworld.HelloReply SayHello(global::Helloworld.HelloRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken));
/// <summary>
/// Sends a greeting
/// </summary>
global::Helloworld.HelloReply SayHello(global::Helloworld.HelloRequest request, CallOptions options); global::Helloworld.HelloReply SayHello(global::Helloworld.HelloRequest request, CallOptions options);
/// <summary>
/// Sends a greeting
/// </summary>
AsyncUnaryCall<global::Helloworld.HelloReply> SayHelloAsync(global::Helloworld.HelloRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)); AsyncUnaryCall<global::Helloworld.HelloReply> SayHelloAsync(global::Helloworld.HelloRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken));
/// <summary>
/// Sends a greeting
/// </summary>
AsyncUnaryCall<global::Helloworld.HelloReply> SayHelloAsync(global::Helloworld.HelloRequest request, CallOptions options); AsyncUnaryCall<global::Helloworld.HelloReply> SayHelloAsync(global::Helloworld.HelloRequest request, CallOptions options);
} }
// server-side interface /// <summary>Interface of server-side implementations of Greeter</summary>
[System.Obsolete("Service implementations should inherit from the generated abstract base class instead.")]
public interface IGreeter public interface IGreeter
{ {
Task<global::Helloworld.HelloReply> SayHello(global::Helloworld.HelloRequest request, ServerCallContext context); /// <summary>
/// Sends a greeting
/// </summary>
global::System.Threading.Tasks.Task<global::Helloworld.HelloReply> SayHello(global::Helloworld.HelloRequest request, ServerCallContext context);
} }
// client stub /// <summary>Base class for server-side implementations of Greeter</summary>
public class GreeterClient : ClientBase, IGreeterClient public abstract class GreeterBase
{
/// <summary>
/// Sends a greeting
/// </summary>
public virtual global::System.Threading.Tasks.Task<global::Helloworld.HelloReply> SayHello(global::Helloworld.HelloRequest request, ServerCallContext context)
{
throw new RpcException(new Status(StatusCode.Unimplemented, ""));
}
}
/// <summary>Client for Greeter</summary>
#pragma warning disable 0618
public class GreeterClient : ClientBase<GreeterClient>, IGreeterClient
#pragma warning restore 0618
{ {
public GreeterClient(Channel channel) : base(channel) public GreeterClient(Channel channel) : base(channel)
{ {
} }
public global::Helloworld.HelloReply SayHello(global::Helloworld.HelloRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) public GreeterClient(CallInvoker callInvoker) : base(callInvoker)
{
}
///<summary>Protected parameterless constructor to allow creation of test doubles.</summary>
protected GreeterClient() : base()
{
}
///<summary>Protected constructor to allow creation of configured clients.</summary>
protected GreeterClient(ClientBaseConfiguration configuration) : base(configuration)
{
}
/// <summary>
/// Sends a greeting
/// </summary>
public virtual global::Helloworld.HelloReply SayHello(global::Helloworld.HelloRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken))
{
return SayHello(request, new CallOptions(headers, deadline, cancellationToken));
}
/// <summary>
/// Sends a greeting
/// </summary>
public virtual global::Helloworld.HelloReply SayHello(global::Helloworld.HelloRequest request, CallOptions options)
{ {
var call = CreateCall(__Method_SayHello, new CallOptions(headers, deadline, cancellationToken)); return CallInvoker.BlockingUnaryCall(__Method_SayHello, null, options, request);
return Calls.BlockingUnaryCall(call, request);
} }
public global::Helloworld.HelloReply SayHello(global::Helloworld.HelloRequest request, CallOptions options) /// <summary>
/// Sends a greeting
/// </summary>
public virtual AsyncUnaryCall<global::Helloworld.HelloReply> SayHelloAsync(global::Helloworld.HelloRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken))
{ {
var call = CreateCall(__Method_SayHello, options); return SayHelloAsync(request, new CallOptions(headers, deadline, cancellationToken));
return Calls.BlockingUnaryCall(call, request);
} }
public AsyncUnaryCall<global::Helloworld.HelloReply> SayHelloAsync(global::Helloworld.HelloRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) /// <summary>
/// Sends a greeting
/// </summary>
public virtual AsyncUnaryCall<global::Helloworld.HelloReply> SayHelloAsync(global::Helloworld.HelloRequest request, CallOptions options)
{ {
var call = CreateCall(__Method_SayHello, new CallOptions(headers, deadline, cancellationToken)); return CallInvoker.AsyncUnaryCall(__Method_SayHello, null, options, request);
return Calls.AsyncUnaryCall(call, request);
} }
public AsyncUnaryCall<global::Helloworld.HelloReply> SayHelloAsync(global::Helloworld.HelloRequest request, CallOptions options) protected override GreeterClient NewInstance(ClientBaseConfiguration configuration)
{ {
var call = CreateCall(__Method_SayHello, options); return new GreeterClient(configuration);
return Calls.AsyncUnaryCall(call, request);
} }
} }
// creates service definition that can be registered with a server /// <summary>Creates a new client for Greeter</summary>
public static GreeterClient NewClient(Channel channel)
{
return new GreeterClient(channel);
}
/// <summary>Creates service definition that can be registered with a server</summary>
#pragma warning disable 0618
public static ServerServiceDefinition BindService(IGreeter serviceImpl) public static ServerServiceDefinition BindService(IGreeter serviceImpl)
#pragma warning restore 0618
{ {
return ServerServiceDefinition.CreateBuilder(__ServiceName) return ServerServiceDefinition.CreateBuilder(__ServiceName)
.AddMethod(__Method_SayHello, serviceImpl.SayHello).Build(); .AddMethod(__Method_SayHello, serviceImpl.SayHello).Build();
} }
// creates a new client /// <summary>Creates service definition that can be registered with a server</summary>
public static GreeterClient NewClient(Channel channel) #pragma warning disable 0618
public static ServerServiceDefinition BindService(GreeterBase serviceImpl)
#pragma warning restore 0618
{ {
return new GreeterClient(channel); return ServerServiceDefinition.CreateBuilder(__ServiceName)
.AddMethod(__Method_SayHello, serviceImpl.SayHello).Build();
} }
} }

@ -1,8 +1,7 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<packages> <packages>
<package id="Google.Protobuf" version="3.0.0-beta2" targetFramework="net45" /> <package id="Google.Protobuf" version="3.0.0-beta2" targetFramework="net45" />
<package id="Grpc" version="0.13.1" targetFramework="net45" /> <package id="Grpc" version="0.14.0" targetFramework="net45" />
<package id="Grpc.Core" version="0.13.1" targetFramework="net45" /> <package id="Grpc.Core" version="0.14.0" targetFramework="net45" />
<package id="grpc.native.csharp" version="0.13.1" targetFramework="net45" />
<package id="Ix-Async" version="1.2.5" targetFramework="net45" /> <package id="Ix-Async" version="1.2.5" targetFramework="net45" />
</packages> </packages>

@ -10,7 +10,7 @@
<RootNamespace>GreeterClient</RootNamespace> <RootNamespace>GreeterClient</RootNamespace>
<AssemblyName>GreeterClient</AssemblyName> <AssemblyName>GreeterClient</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion> <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<NuGetPackageImportStamp>d94f6f5f</NuGetPackageImportStamp> <NuGetPackageImportStamp>63b59176</NuGetPackageImportStamp>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols> <DebugSymbols>true</DebugSymbols>
@ -35,9 +35,9 @@
<SpecificVersion>False</SpecificVersion> <SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\Google.Protobuf.3.0.0-beta2\lib\portable-net45+netcore45+wpa81+wp8\Google.Protobuf.dll</HintPath> <HintPath>..\packages\Google.Protobuf.3.0.0-beta2\lib\portable-net45+netcore45+wpa81+wp8\Google.Protobuf.dll</HintPath>
</Reference> </Reference>
<Reference Include="Grpc.Core, Version=0.13.1.0, Culture=neutral, PublicKeyToken=d754f35622e28bad, processorArchitecture=MSIL"> <Reference Include="Grpc.Core, Version=1.0.0.0, Culture=neutral, PublicKeyToken=d754f35622e28bad, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion> <SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\Grpc.Core.0.13.1\lib\net45\Grpc.Core.dll</HintPath> <HintPath>..\packages\Grpc.Core.0.14.0\lib\net45\Grpc.Core.dll</HintPath>
</Reference> </Reference>
<Reference Include="System" /> <Reference Include="System" />
<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">
@ -59,11 +59,11 @@
<ItemGroup> <ItemGroup>
<None Include="packages.config" /> <None Include="packages.config" />
</ItemGroup> </ItemGroup>
<Import Project="..\packages\grpc.native.csharp.0.13.1\build\portable-net45+netcore45+wpa81+wp8\grpc.native.csharp.targets" Condition="Exists('..\packages\grpc.native.csharp.0.13.1\build\portable-net45+netcore45+wpa81+wp8\grpc.native.csharp.targets')" /> <Import Project="..\packages\Grpc.Core.0.14.0\build\net45\Grpc.Core.targets" Condition="Exists('..\packages\Grpc.Core.0.14.0\build\net45\Grpc.Core.targets')" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild"> <Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup> <PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText> <ErrorText>This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup> </PropertyGroup>
<Error Condition="!Exists('..\packages\grpc.native.csharp.0.13.1\build\portable-net45+netcore45+wpa81+wp8\grpc.native.csharp.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\grpc.native.csharp.0.13.1\build\portable-net45+netcore45+wpa81+wp8\grpc.native.csharp.targets'))" /> <Error Condition="!Exists('..\packages\Grpc.Core.0.14.0\build\net45\Grpc.Core.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Grpc.Core.0.14.0\build\net45\Grpc.Core.targets'))" />
</Target> </Target>
</Project> </Project>

@ -1,8 +1,7 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<packages> <packages>
<package id="Google.Protobuf" version="3.0.0-beta2" targetFramework="net45" /> <package id="Google.Protobuf" version="3.0.0-beta2" targetFramework="net45" />
<package id="Grpc" version="0.13.1" targetFramework="net45" /> <package id="Grpc" version="0.14.0" targetFramework="net45" />
<package id="Grpc.Core" version="0.13.1" targetFramework="net45" /> <package id="Grpc.Core" version="0.14.0" targetFramework="net45" />
<package id="grpc.native.csharp" version="0.13.1" targetFramework="net45" />
<package id="Ix-Async" version="1.2.5" targetFramework="net45" /> <package id="Ix-Async" version="1.2.5" targetFramework="net45" />
</packages> </packages>

@ -10,7 +10,7 @@
<RootNamespace>GreeterServer</RootNamespace> <RootNamespace>GreeterServer</RootNamespace>
<AssemblyName>GreeterServer</AssemblyName> <AssemblyName>GreeterServer</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion> <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<NuGetPackageImportStamp>6f89e9f2</NuGetPackageImportStamp> <NuGetPackageImportStamp>25ac2e80</NuGetPackageImportStamp>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols> <DebugSymbols>true</DebugSymbols>
@ -35,9 +35,9 @@
<SpecificVersion>False</SpecificVersion> <SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\Google.Protobuf.3.0.0-beta2\lib\portable-net45+netcore45+wpa81+wp8\Google.Protobuf.dll</HintPath> <HintPath>..\packages\Google.Protobuf.3.0.0-beta2\lib\portable-net45+netcore45+wpa81+wp8\Google.Protobuf.dll</HintPath>
</Reference> </Reference>
<Reference Include="Grpc.Core, Version=0.13.1.0, Culture=neutral, PublicKeyToken=d754f35622e28bad, processorArchitecture=MSIL"> <Reference Include="Grpc.Core, Version=1.0.0.0, Culture=neutral, PublicKeyToken=d754f35622e28bad, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion> <SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\Grpc.Core.0.13.1\lib\net45\Grpc.Core.dll</HintPath> <HintPath>..\packages\Grpc.Core.0.14.0\lib\net45\Grpc.Core.dll</HintPath>
</Reference> </Reference>
<Reference Include="System" /> <Reference Include="System" />
<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">
@ -59,11 +59,11 @@
<ItemGroup> <ItemGroup>
<None Include="packages.config" /> <None Include="packages.config" />
</ItemGroup> </ItemGroup>
<Import Project="..\packages\grpc.native.csharp.0.13.1\build\portable-net45+netcore45+wpa81+wp8\grpc.native.csharp.targets" Condition="Exists('..\packages\grpc.native.csharp.0.13.1\build\portable-net45+netcore45+wpa81+wp8\grpc.native.csharp.targets')" /> <Import Project="..\packages\Grpc.Core.0.14.0\build\net45\Grpc.Core.targets" Condition="Exists('..\packages\Grpc.Core.0.14.0\build\net45\Grpc.Core.targets')" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild"> <Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup> <PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText> <ErrorText>This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup> </PropertyGroup>
<Error Condition="!Exists('..\packages\grpc.native.csharp.0.13.1\build\portable-net45+netcore45+wpa81+wp8\grpc.native.csharp.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\grpc.native.csharp.0.13.1\build\portable-net45+netcore45+wpa81+wp8\grpc.native.csharp.targets'))" /> <Error Condition="!Exists('..\packages\Grpc.Core.0.14.0\build\net45\Grpc.Core.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Grpc.Core.0.14.0\build\net45\Grpc.Core.targets'))" />
</Target> </Target>
</Project> </Project>

@ -34,10 +34,10 @@ using Helloworld;
namespace GreeterServer namespace GreeterServer
{ {
class GreeterImpl : Greeter.IGreeter class GreeterImpl : Greeter.GreeterBase
{ {
// Server side handler of the SayHello RPC // Server side handler of the SayHello RPC
public Task<HelloReply> SayHello(HelloRequest request, ServerCallContext context) public override Task<HelloReply> SayHello(HelloRequest request, ServerCallContext context)
{ {
return Task.FromResult(new HelloReply { Message = "Hello " + request.Name }); return Task.FromResult(new HelloReply { Message = "Hello " + request.Name });
} }

@ -1,8 +1,7 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<packages> <packages>
<package id="Google.Protobuf" version="3.0.0-beta2" targetFramework="net45" /> <package id="Google.Protobuf" version="3.0.0-beta2" targetFramework="net45" />
<package id="Grpc" version="0.13.1" targetFramework="net45" /> <package id="Grpc" version="0.14.0" targetFramework="net45" />
<package id="Grpc.Core" version="0.13.1" targetFramework="net45" /> <package id="Grpc.Core" version="0.14.0" targetFramework="net45" />
<package id="grpc.native.csharp" version="0.13.1" targetFramework="net45" />
<package id="Ix-Async" version="1.2.5" targetFramework="net45" /> <package id="Ix-Async" version="1.2.5" targetFramework="net45" />
</packages> </packages>

@ -34,7 +34,7 @@ setlocal
@rem enter this directory @rem enter this directory
cd /d %~dp0 cd /d %~dp0
set TOOLS_PATH=packages\Grpc.Tools.0.13.1\tools\windows_x86 set TOOLS_PATH=packages\Grpc.Tools.0.14.0\tools\windows_x86
%TOOLS_PATH%\protoc.exe -I../../protos --csharp_out Greeter ../../protos/helloworld.proto --grpc_out Greeter --plugin=protoc-gen-grpc=%TOOLS_PATH%\grpc_csharp_plugin.exe %TOOLS_PATH%\protoc.exe -I../../protos --csharp_out Greeter ../../protos/helloworld.proto --grpc_out Greeter --plugin=protoc-gen-grpc=%TOOLS_PATH%\grpc_csharp_plugin.exe

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<packages> <packages>
<package id="Grpc.Tools" version="0.13.1" /> <package id="Grpc.Tools" version="0.14.0" />
</packages> </packages>

@ -11,7 +11,7 @@
<AssemblyName>RouteGuide</AssemblyName> <AssemblyName>RouteGuide</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion> <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment> <FileAlignment>512</FileAlignment>
<NuGetPackageImportStamp>e1e648e7</NuGetPackageImportStamp> <NuGetPackageImportStamp>0a9fcb7a</NuGetPackageImportStamp>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols> <DebugSymbols>true</DebugSymbols>
@ -35,9 +35,9 @@
<SpecificVersion>False</SpecificVersion> <SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\Google.Protobuf.3.0.0-beta2\lib\portable-net45+netcore45+wpa81+wp8\Google.Protobuf.dll</HintPath> <HintPath>..\packages\Google.Protobuf.3.0.0-beta2\lib\portable-net45+netcore45+wpa81+wp8\Google.Protobuf.dll</HintPath>
</Reference> </Reference>
<Reference Include="Grpc.Core, Version=0.13.1.0, Culture=neutral, PublicKeyToken=d754f35622e28bad, processorArchitecture=MSIL"> <Reference Include="Grpc.Core, Version=1.0.0.0, Culture=neutral, PublicKeyToken=d754f35622e28bad, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion> <SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\Grpc.Core.0.13.1\lib\net45\Grpc.Core.dll</HintPath> <HintPath>..\packages\Grpc.Core.0.14.0\lib\net45\Grpc.Core.dll</HintPath>
</Reference> </Reference>
<Reference Include="Newtonsoft.Json, Version=7.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL"> <Reference Include="Newtonsoft.Json, Version=7.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion> <SpecificVersion>False</SpecificVersion>
@ -74,12 +74,12 @@
</None> </None>
</ItemGroup> </ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="..\packages\grpc.native.csharp.0.13.1\build\portable-net45+netcore45+wpa81+wp8\grpc.native.csharp.targets" Condition="Exists('..\packages\grpc.native.csharp.0.13.1\build\portable-net45+netcore45+wpa81+wp8\grpc.native.csharp.targets')" /> <Import Project="..\packages\Grpc.Core.0.14.0\build\net45\Grpc.Core.targets" Condition="Exists('..\packages\Grpc.Core.0.14.0\build\net45\Grpc.Core.targets')" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild"> <Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup> <PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText> <ErrorText>This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup> </PropertyGroup>
<Error Condition="!Exists('..\packages\grpc.native.csharp.0.13.1\build\portable-net45+netcore45+wpa81+wp8\grpc.native.csharp.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\grpc.native.csharp.0.13.1\build\portable-net45+netcore45+wpa81+wp8\grpc.native.csharp.targets'))" /> <Error Condition="!Exists('..\packages\Grpc.Core.0.14.0\build\net45\Grpc.Core.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Grpc.Core.0.14.0\build\net45\Grpc.Core.targets'))" />
</Target> </Target>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it. <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets. Other similar extension points exist, see Microsoft.Common.targets.

@ -1,5 +1,35 @@
// Generated by the protocol buffer compiler. DO NOT EDIT! // Generated by the protocol buffer compiler. DO NOT EDIT!
// source: route_guide.proto // source: route_guide.proto
// Original file comments:
// Copyright 2015, Google Inc.
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the names of its
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
#region Designer generated code #region Designer generated code
using System; using System;
@ -8,6 +38,9 @@ using System.Threading.Tasks;
using Grpc.Core; using Grpc.Core;
namespace Routeguide { namespace Routeguide {
/// <summary>
/// Interface exported by the server.
/// </summary>
public static class RouteGuide public static class RouteGuide
{ {
static readonly string __ServiceName = "routeguide.RouteGuide"; static readonly string __ServiceName = "routeguide.RouteGuide";
@ -46,96 +79,339 @@ namespace Routeguide {
__Marshaller_RouteNote, __Marshaller_RouteNote,
__Marshaller_RouteNote); __Marshaller_RouteNote);
// service descriptor /// <summary>Service descriptor</summary>
public static global::Google.Protobuf.Reflection.ServiceDescriptor Descriptor public static global::Google.Protobuf.Reflection.ServiceDescriptor Descriptor
{ {
get { return global::Routeguide.RouteGuideReflection.Descriptor.Services[0]; } get { return global::Routeguide.RouteGuideReflection.Descriptor.Services[0]; }
} }
// client interface /// <summary>Client for RouteGuide</summary>
[System.Obsolete("Client side interfaced will be removed in the next release. Use client class directly.")]
public interface IRouteGuideClient public interface IRouteGuideClient
{ {
/// <summary>
/// A simple RPC.
///
/// Obtains the feature at a given position.
///
/// A feature with an empty name is returned if there's no feature at the given
/// position.
/// </summary>
global::Routeguide.Feature GetFeature(global::Routeguide.Point request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)); global::Routeguide.Feature GetFeature(global::Routeguide.Point request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken));
/// <summary>
/// A simple RPC.
///
/// Obtains the feature at a given position.
///
/// A feature with an empty name is returned if there's no feature at the given
/// position.
/// </summary>
global::Routeguide.Feature GetFeature(global::Routeguide.Point request, CallOptions options); global::Routeguide.Feature GetFeature(global::Routeguide.Point request, CallOptions options);
/// <summary>
/// A simple RPC.
///
/// Obtains the feature at a given position.
///
/// A feature with an empty name is returned if there's no feature at the given
/// position.
/// </summary>
AsyncUnaryCall<global::Routeguide.Feature> GetFeatureAsync(global::Routeguide.Point request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)); AsyncUnaryCall<global::Routeguide.Feature> GetFeatureAsync(global::Routeguide.Point request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken));
/// <summary>
/// A simple RPC.
///
/// Obtains the feature at a given position.
///
/// A feature with an empty name is returned if there's no feature at the given
/// position.
/// </summary>
AsyncUnaryCall<global::Routeguide.Feature> GetFeatureAsync(global::Routeguide.Point request, CallOptions options); AsyncUnaryCall<global::Routeguide.Feature> GetFeatureAsync(global::Routeguide.Point request, CallOptions options);
/// <summary>
/// A server-to-client streaming RPC.
///
/// Obtains the Features available within the given Rectangle. Results are
/// streamed rather than returned at once (e.g. in a response message with a
/// repeated field), as the rectangle may cover a large area and contain a
/// huge number of features.
/// </summary>
AsyncServerStreamingCall<global::Routeguide.Feature> ListFeatures(global::Routeguide.Rectangle request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)); AsyncServerStreamingCall<global::Routeguide.Feature> ListFeatures(global::Routeguide.Rectangle request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken));
/// <summary>
/// A server-to-client streaming RPC.
///
/// Obtains the Features available within the given Rectangle. Results are
/// streamed rather than returned at once (e.g. in a response message with a
/// repeated field), as the rectangle may cover a large area and contain a
/// huge number of features.
/// </summary>
AsyncServerStreamingCall<global::Routeguide.Feature> ListFeatures(global::Routeguide.Rectangle request, CallOptions options); AsyncServerStreamingCall<global::Routeguide.Feature> ListFeatures(global::Routeguide.Rectangle request, CallOptions options);
/// <summary>
/// A client-to-server streaming RPC.
///
/// Accepts a stream of Points on a route being traversed, returning a
/// RouteSummary when traversal is completed.
/// </summary>
AsyncClientStreamingCall<global::Routeguide.Point, global::Routeguide.RouteSummary> RecordRoute(Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)); AsyncClientStreamingCall<global::Routeguide.Point, global::Routeguide.RouteSummary> RecordRoute(Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken));
/// <summary>
/// A client-to-server streaming RPC.
///
/// Accepts a stream of Points on a route being traversed, returning a
/// RouteSummary when traversal is completed.
/// </summary>
AsyncClientStreamingCall<global::Routeguide.Point, global::Routeguide.RouteSummary> RecordRoute(CallOptions options); AsyncClientStreamingCall<global::Routeguide.Point, global::Routeguide.RouteSummary> RecordRoute(CallOptions options);
/// <summary>
/// A Bidirectional streaming RPC.
///
/// Accepts a stream of RouteNotes sent while a route is being traversed,
/// while receiving other RouteNotes (e.g. from other users).
/// </summary>
AsyncDuplexStreamingCall<global::Routeguide.RouteNote, global::Routeguide.RouteNote> RouteChat(Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)); AsyncDuplexStreamingCall<global::Routeguide.RouteNote, global::Routeguide.RouteNote> RouteChat(Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken));
/// <summary>
/// A Bidirectional streaming RPC.
///
/// Accepts a stream of RouteNotes sent while a route is being traversed,
/// while receiving other RouteNotes (e.g. from other users).
/// </summary>
AsyncDuplexStreamingCall<global::Routeguide.RouteNote, global::Routeguide.RouteNote> RouteChat(CallOptions options); AsyncDuplexStreamingCall<global::Routeguide.RouteNote, global::Routeguide.RouteNote> RouteChat(CallOptions options);
} }
// server-side interface /// <summary>Interface of server-side implementations of RouteGuide</summary>
[System.Obsolete("Service implementations should inherit from the generated abstract base class instead.")]
public interface IRouteGuide public interface IRouteGuide
{ {
Task<global::Routeguide.Feature> GetFeature(global::Routeguide.Point request, ServerCallContext context); /// <summary>
Task ListFeatures(global::Routeguide.Rectangle request, IServerStreamWriter<global::Routeguide.Feature> responseStream, ServerCallContext context); /// A simple RPC.
Task<global::Routeguide.RouteSummary> RecordRoute(IAsyncStreamReader<global::Routeguide.Point> requestStream, ServerCallContext context); ///
Task RouteChat(IAsyncStreamReader<global::Routeguide.RouteNote> requestStream, IServerStreamWriter<global::Routeguide.RouteNote> responseStream, ServerCallContext context); /// Obtains the feature at a given position.
///
/// A feature with an empty name is returned if there's no feature at the given
/// position.
/// </summary>
global::System.Threading.Tasks.Task<global::Routeguide.Feature> GetFeature(global::Routeguide.Point request, ServerCallContext context);
/// <summary>
/// A server-to-client streaming RPC.
///
/// Obtains the Features available within the given Rectangle. Results are
/// streamed rather than returned at once (e.g. in a response message with a
/// repeated field), as the rectangle may cover a large area and contain a
/// huge number of features.
/// </summary>
global::System.Threading.Tasks.Task ListFeatures(global::Routeguide.Rectangle request, IServerStreamWriter<global::Routeguide.Feature> responseStream, ServerCallContext context);
/// <summary>
/// A client-to-server streaming RPC.
///
/// Accepts a stream of Points on a route being traversed, returning a
/// RouteSummary when traversal is completed.
/// </summary>
global::System.Threading.Tasks.Task<global::Routeguide.RouteSummary> RecordRoute(IAsyncStreamReader<global::Routeguide.Point> requestStream, ServerCallContext context);
/// <summary>
/// A Bidirectional streaming RPC.
///
/// Accepts a stream of RouteNotes sent while a route is being traversed,
/// while receiving other RouteNotes (e.g. from other users).
/// </summary>
global::System.Threading.Tasks.Task RouteChat(IAsyncStreamReader<global::Routeguide.RouteNote> requestStream, IServerStreamWriter<global::Routeguide.RouteNote> responseStream, ServerCallContext context);
} }
// client stub /// <summary>Base class for server-side implementations of RouteGuide</summary>
public class RouteGuideClient : ClientBase, IRouteGuideClient public abstract class RouteGuideBase
{
/// <summary>
/// A simple RPC.
///
/// Obtains the feature at a given position.
///
/// A feature with an empty name is returned if there's no feature at the given
/// position.
/// </summary>
public virtual global::System.Threading.Tasks.Task<global::Routeguide.Feature> GetFeature(global::Routeguide.Point request, ServerCallContext context)
{
throw new RpcException(new Status(StatusCode.Unimplemented, ""));
}
/// <summary>
/// A server-to-client streaming RPC.
///
/// Obtains the Features available within the given Rectangle. Results are
/// streamed rather than returned at once (e.g. in a response message with a
/// repeated field), as the rectangle may cover a large area and contain a
/// huge number of features.
/// </summary>
public virtual global::System.Threading.Tasks.Task ListFeatures(global::Routeguide.Rectangle request, IServerStreamWriter<global::Routeguide.Feature> responseStream, ServerCallContext context)
{
throw new RpcException(new Status(StatusCode.Unimplemented, ""));
}
/// <summary>
/// A client-to-server streaming RPC.
///
/// Accepts a stream of Points on a route being traversed, returning a
/// RouteSummary when traversal is completed.
/// </summary>
public virtual global::System.Threading.Tasks.Task<global::Routeguide.RouteSummary> RecordRoute(IAsyncStreamReader<global::Routeguide.Point> requestStream, ServerCallContext context)
{
throw new RpcException(new Status(StatusCode.Unimplemented, ""));
}
/// <summary>
/// A Bidirectional streaming RPC.
///
/// Accepts a stream of RouteNotes sent while a route is being traversed,
/// while receiving other RouteNotes (e.g. from other users).
/// </summary>
public virtual global::System.Threading.Tasks.Task RouteChat(IAsyncStreamReader<global::Routeguide.RouteNote> requestStream, IServerStreamWriter<global::Routeguide.RouteNote> responseStream, ServerCallContext context)
{
throw new RpcException(new Status(StatusCode.Unimplemented, ""));
}
}
/// <summary>Client for RouteGuide</summary>
#pragma warning disable 0618
public class RouteGuideClient : ClientBase<RouteGuideClient>, IRouteGuideClient
#pragma warning restore 0618
{ {
public RouteGuideClient(Channel channel) : base(channel) public RouteGuideClient(Channel channel) : base(channel)
{ {
} }
public global::Routeguide.Feature GetFeature(global::Routeguide.Point request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) public RouteGuideClient(CallInvoker callInvoker) : base(callInvoker)
{
}
///<summary>Protected parameterless constructor to allow creation of test doubles.</summary>
protected RouteGuideClient() : base()
{
}
///<summary>Protected constructor to allow creation of configured clients.</summary>
protected RouteGuideClient(ClientBaseConfiguration configuration) : base(configuration)
{ {
var call = CreateCall(__Method_GetFeature, new CallOptions(headers, deadline, cancellationToken));
return Calls.BlockingUnaryCall(call, request);
} }
public global::Routeguide.Feature GetFeature(global::Routeguide.Point request, CallOptions options)
/// <summary>
/// A simple RPC.
///
/// Obtains the feature at a given position.
///
/// A feature with an empty name is returned if there's no feature at the given
/// position.
/// </summary>
public virtual global::Routeguide.Feature GetFeature(global::Routeguide.Point request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken))
{ {
var call = CreateCall(__Method_GetFeature, options); return GetFeature(request, new CallOptions(headers, deadline, cancellationToken));
return Calls.BlockingUnaryCall(call, request);
} }
public AsyncUnaryCall<global::Routeguide.Feature> GetFeatureAsync(global::Routeguide.Point request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) /// <summary>
/// A simple RPC.
///
/// Obtains the feature at a given position.
///
/// A feature with an empty name is returned if there's no feature at the given
/// position.
/// </summary>
public virtual global::Routeguide.Feature GetFeature(global::Routeguide.Point request, CallOptions options)
{ {
var call = CreateCall(__Method_GetFeature, new CallOptions(headers, deadline, cancellationToken)); return CallInvoker.BlockingUnaryCall(__Method_GetFeature, null, options, request);
return Calls.AsyncUnaryCall(call, request);
} }
public AsyncUnaryCall<global::Routeguide.Feature> GetFeatureAsync(global::Routeguide.Point request, CallOptions options) /// <summary>
/// A simple RPC.
///
/// Obtains the feature at a given position.
///
/// A feature with an empty name is returned if there's no feature at the given
/// position.
/// </summary>
public virtual AsyncUnaryCall<global::Routeguide.Feature> GetFeatureAsync(global::Routeguide.Point request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken))
{ {
var call = CreateCall(__Method_GetFeature, options); return GetFeatureAsync(request, new CallOptions(headers, deadline, cancellationToken));
return Calls.AsyncUnaryCall(call, request);
} }
public AsyncServerStreamingCall<global::Routeguide.Feature> ListFeatures(global::Routeguide.Rectangle request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) /// <summary>
/// A simple RPC.
///
/// Obtains the feature at a given position.
///
/// A feature with an empty name is returned if there's no feature at the given
/// position.
/// </summary>
public virtual AsyncUnaryCall<global::Routeguide.Feature> GetFeatureAsync(global::Routeguide.Point request, CallOptions options)
{ {
var call = CreateCall(__Method_ListFeatures, new CallOptions(headers, deadline, cancellationToken)); return CallInvoker.AsyncUnaryCall(__Method_GetFeature, null, options, request);
return Calls.AsyncServerStreamingCall(call, request);
} }
public AsyncServerStreamingCall<global::Routeguide.Feature> ListFeatures(global::Routeguide.Rectangle request, CallOptions options) /// <summary>
/// A server-to-client streaming RPC.
///
/// Obtains the Features available within the given Rectangle. Results are
/// streamed rather than returned at once (e.g. in a response message with a
/// repeated field), as the rectangle may cover a large area and contain a
/// huge number of features.
/// </summary>
public virtual AsyncServerStreamingCall<global::Routeguide.Feature> ListFeatures(global::Routeguide.Rectangle request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken))
{ {
var call = CreateCall(__Method_ListFeatures, options); return ListFeatures(request, new CallOptions(headers, deadline, cancellationToken));
return Calls.AsyncServerStreamingCall(call, request);
} }
public AsyncClientStreamingCall<global::Routeguide.Point, global::Routeguide.RouteSummary> RecordRoute(Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) /// <summary>
/// A server-to-client streaming RPC.
///
/// Obtains the Features available within the given Rectangle. Results are
/// streamed rather than returned at once (e.g. in a response message with a
/// repeated field), as the rectangle may cover a large area and contain a
/// huge number of features.
/// </summary>
public virtual AsyncServerStreamingCall<global::Routeguide.Feature> ListFeatures(global::Routeguide.Rectangle request, CallOptions options)
{ {
var call = CreateCall(__Method_RecordRoute, new CallOptions(headers, deadline, cancellationToken)); return CallInvoker.AsyncServerStreamingCall(__Method_ListFeatures, null, options, request);
return Calls.AsyncClientStreamingCall(call);
} }
public AsyncClientStreamingCall<global::Routeguide.Point, global::Routeguide.RouteSummary> RecordRoute(CallOptions options) /// <summary>
/// A client-to-server streaming RPC.
///
/// Accepts a stream of Points on a route being traversed, returning a
/// RouteSummary when traversal is completed.
/// </summary>
public virtual AsyncClientStreamingCall<global::Routeguide.Point, global::Routeguide.RouteSummary> RecordRoute(Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken))
{ {
var call = CreateCall(__Method_RecordRoute, options); return RecordRoute(new CallOptions(headers, deadline, cancellationToken));
return Calls.AsyncClientStreamingCall(call);
} }
public AsyncDuplexStreamingCall<global::Routeguide.RouteNote, global::Routeguide.RouteNote> RouteChat(Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) /// <summary>
/// A client-to-server streaming RPC.
///
/// Accepts a stream of Points on a route being traversed, returning a
/// RouteSummary when traversal is completed.
/// </summary>
public virtual AsyncClientStreamingCall<global::Routeguide.Point, global::Routeguide.RouteSummary> RecordRoute(CallOptions options)
{ {
var call = CreateCall(__Method_RouteChat, new CallOptions(headers, deadline, cancellationToken)); return CallInvoker.AsyncClientStreamingCall(__Method_RecordRoute, null, options);
return Calls.AsyncDuplexStreamingCall(call);
} }
public AsyncDuplexStreamingCall<global::Routeguide.RouteNote, global::Routeguide.RouteNote> RouteChat(CallOptions options) /// <summary>
/// A Bidirectional streaming RPC.
///
/// Accepts a stream of RouteNotes sent while a route is being traversed,
/// while receiving other RouteNotes (e.g. from other users).
/// </summary>
public virtual AsyncDuplexStreamingCall<global::Routeguide.RouteNote, global::Routeguide.RouteNote> RouteChat(Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken))
{ {
var call = CreateCall(__Method_RouteChat, options); return RouteChat(new CallOptions(headers, deadline, cancellationToken));
return Calls.AsyncDuplexStreamingCall(call);
} }
/// <summary>
/// A Bidirectional streaming RPC.
///
/// Accepts a stream of RouteNotes sent while a route is being traversed,
/// while receiving other RouteNotes (e.g. from other users).
/// </summary>
public virtual AsyncDuplexStreamingCall<global::Routeguide.RouteNote, global::Routeguide.RouteNote> RouteChat(CallOptions options)
{
return CallInvoker.AsyncDuplexStreamingCall(__Method_RouteChat, null, options);
}
protected override RouteGuideClient NewInstance(ClientBaseConfiguration configuration)
{
return new RouteGuideClient(configuration);
}
}
/// <summary>Creates a new client for RouteGuide</summary>
public static RouteGuideClient NewClient(Channel channel)
{
return new RouteGuideClient(channel);
} }
// creates service definition that can be registered with a server /// <summary>Creates service definition that can be registered with a server</summary>
#pragma warning disable 0618
public static ServerServiceDefinition BindService(IRouteGuide serviceImpl) public static ServerServiceDefinition BindService(IRouteGuide serviceImpl)
#pragma warning restore 0618
{ {
return ServerServiceDefinition.CreateBuilder(__ServiceName) return ServerServiceDefinition.CreateBuilder(__ServiceName)
.AddMethod(__Method_GetFeature, serviceImpl.GetFeature) .AddMethod(__Method_GetFeature, serviceImpl.GetFeature)
@ -144,10 +420,16 @@ namespace Routeguide {
.AddMethod(__Method_RouteChat, serviceImpl.RouteChat).Build(); .AddMethod(__Method_RouteChat, serviceImpl.RouteChat).Build();
} }
// creates a new client /// <summary>Creates service definition that can be registered with a server</summary>
public static RouteGuideClient NewClient(Channel channel) #pragma warning disable 0618
public static ServerServiceDefinition BindService(RouteGuideBase serviceImpl)
#pragma warning restore 0618
{ {
return new RouteGuideClient(channel); return ServerServiceDefinition.CreateBuilder(__ServiceName)
.AddMethod(__Method_GetFeature, serviceImpl.GetFeature)
.AddMethod(__Method_ListFeatures, serviceImpl.ListFeatures)
.AddMethod(__Method_RecordRoute, serviceImpl.RecordRoute)
.AddMethod(__Method_RouteChat, serviceImpl.RouteChat).Build();
} }
} }

@ -1,9 +1,8 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<packages> <packages>
<package id="Google.Protobuf" version="3.0.0-beta2" targetFramework="net45" /> <package id="Google.Protobuf" version="3.0.0-beta2" targetFramework="net45" />
<package id="Grpc" version="0.13.1" targetFramework="net45" /> <package id="Grpc" version="0.14.0" targetFramework="net45" />
<package id="Grpc.Core" version="0.13.1" targetFramework="net45" /> <package id="Grpc.Core" version="0.14.0" targetFramework="net45" />
<package id="grpc.native.csharp" version="0.13.1" targetFramework="net45" />
<package id="Ix-Async" version="1.2.5" targetFramework="net45" /> <package id="Ix-Async" version="1.2.5" targetFramework="net45" />
<package id="Newtonsoft.Json" version="7.0.1" targetFramework="net45" /> <package id="Newtonsoft.Json" version="7.0.1" targetFramework="net45" />
</packages> </packages>

@ -43,9 +43,9 @@ namespace Routeguide
/// </summary> /// </summary>
public class RouteGuideClient public class RouteGuideClient
{ {
readonly RouteGuide.IRouteGuideClient client; readonly RouteGuide.RouteGuideClient client;
public RouteGuideClient(RouteGuide.IRouteGuideClient client) public RouteGuideClient(RouteGuide.RouteGuideClient client)
{ {
this.client = client; this.client = client;
} }

@ -11,7 +11,7 @@
<AssemblyName>RouteGuideClient</AssemblyName> <AssemblyName>RouteGuideClient</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion> <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment> <FileAlignment>512</FileAlignment>
<NuGetPackageImportStamp>2a1dd0a1</NuGetPackageImportStamp> <NuGetPackageImportStamp>8ef088f0</NuGetPackageImportStamp>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget> <PlatformTarget>AnyCPU</PlatformTarget>
@ -37,9 +37,9 @@
<SpecificVersion>False</SpecificVersion> <SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\Google.Protobuf.3.0.0-beta2\lib\portable-net45+netcore45+wpa81+wp8\Google.Protobuf.dll</HintPath> <HintPath>..\packages\Google.Protobuf.3.0.0-beta2\lib\portable-net45+netcore45+wpa81+wp8\Google.Protobuf.dll</HintPath>
</Reference> </Reference>
<Reference Include="Grpc.Core, Version=0.13.1.0, Culture=neutral, PublicKeyToken=d754f35622e28bad, processorArchitecture=MSIL"> <Reference Include="Grpc.Core, Version=1.0.0.0, Culture=neutral, PublicKeyToken=d754f35622e28bad, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion> <SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\Grpc.Core.0.13.1\lib\net45\Grpc.Core.dll</HintPath> <HintPath>..\packages\Grpc.Core.0.14.0\lib\net45\Grpc.Core.dll</HintPath>
</Reference> </Reference>
<Reference Include="Newtonsoft.Json, Version=7.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL"> <Reference Include="Newtonsoft.Json, Version=7.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion> <SpecificVersion>False</SpecificVersion>
@ -71,12 +71,12 @@
</ProjectReference> </ProjectReference>
</ItemGroup> </ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="..\packages\grpc.native.csharp.0.13.1\build\portable-net45+netcore45+wpa81+wp8\grpc.native.csharp.targets" Condition="Exists('..\packages\grpc.native.csharp.0.13.1\build\portable-net45+netcore45+wpa81+wp8\grpc.native.csharp.targets')" /> <Import Project="..\packages\Grpc.Core.0.14.0\build\net45\Grpc.Core.targets" Condition="Exists('..\packages\Grpc.Core.0.14.0\build\net45\Grpc.Core.targets')" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild"> <Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup> <PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText> <ErrorText>This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup> </PropertyGroup>
<Error Condition="!Exists('..\packages\grpc.native.csharp.0.13.1\build\portable-net45+netcore45+wpa81+wp8\grpc.native.csharp.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\grpc.native.csharp.0.13.1\build\portable-net45+netcore45+wpa81+wp8\grpc.native.csharp.targets'))" /> <Error Condition="!Exists('..\packages\Grpc.Core.0.14.0\build\net45\Grpc.Core.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Grpc.Core.0.14.0\build\net45\Grpc.Core.targets'))" />
</Target> </Target>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it. <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets. Other similar extension points exist, see Microsoft.Common.targets.

@ -1,9 +1,8 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<packages> <packages>
<package id="Google.Protobuf" version="3.0.0-beta2" targetFramework="net45" /> <package id="Google.Protobuf" version="3.0.0-beta2" targetFramework="net45" />
<package id="Grpc" version="0.13.1" targetFramework="net45" /> <package id="Grpc" version="0.14.0" targetFramework="net45" />
<package id="Grpc.Core" version="0.13.1" targetFramework="net45" /> <package id="Grpc.Core" version="0.14.0" targetFramework="net45" />
<package id="grpc.native.csharp" version="0.13.1" targetFramework="net45" />
<package id="Ix-Async" version="1.2.5" targetFramework="net45" /> <package id="Ix-Async" version="1.2.5" targetFramework="net45" />
<package id="Newtonsoft.Json" version="7.0.1" targetFramework="net45" /> <package id="Newtonsoft.Json" version="7.0.1" targetFramework="net45" />
</packages> </packages>

@ -35,6 +35,7 @@ using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using Grpc.Core;
using Grpc.Core.Utils; using Grpc.Core.Utils;
namespace Routeguide namespace Routeguide
@ -42,7 +43,7 @@ namespace Routeguide
/// <summary> /// <summary>
/// Example implementation of RouteGuide server. /// Example implementation of RouteGuide server.
/// </summary> /// </summary>
public class RouteGuideImpl : RouteGuide.IRouteGuide public class RouteGuideImpl : RouteGuide.RouteGuideBase
{ {
readonly List<Feature> features; readonly List<Feature> features;
readonly object myLock = new object(); readonly object myLock = new object();
@ -57,7 +58,7 @@ namespace Routeguide
/// Gets the feature at the requested point. If no feature at that location /// Gets the feature at the requested point. If no feature at that location
/// exists, an unnammed feature is returned at the provided location. /// exists, an unnammed feature is returned at the provided location.
/// </summary> /// </summary>
public Task<Feature> GetFeature(Point request, Grpc.Core.ServerCallContext context) public override Task<Feature> GetFeature(Point request, ServerCallContext context)
{ {
return Task.FromResult(CheckFeature(request)); return Task.FromResult(CheckFeature(request));
} }
@ -65,7 +66,7 @@ namespace Routeguide
/// <summary> /// <summary>
/// Gets all features contained within the given bounding rectangle. /// Gets all features contained within the given bounding rectangle.
/// </summary> /// </summary>
public async Task ListFeatures(Rectangle request, Grpc.Core.IServerStreamWriter<Feature> responseStream, Grpc.Core.ServerCallContext context) public override async Task ListFeatures(Rectangle request, IServerStreamWriter<Feature> responseStream, ServerCallContext context)
{ {
var responses = features.FindAll( (feature) => feature.Exists() && request.Contains(feature.Location) ); var responses = features.FindAll( (feature) => feature.Exists() && request.Contains(feature.Location) );
foreach (var response in responses) foreach (var response in responses)
@ -78,7 +79,7 @@ namespace Routeguide
/// Gets a stream of points, and responds with statistics about the "trip": number of points, /// Gets a stream of points, and responds with statistics about the "trip": number of points,
/// number of known features visited, total distance traveled, and total time spent. /// number of known features visited, total distance traveled, and total time spent.
/// </summary> /// </summary>
public async Task<RouteSummary> RecordRoute(Grpc.Core.IAsyncStreamReader<Point> requestStream, Grpc.Core.ServerCallContext context) public override async Task<RouteSummary> RecordRoute(IAsyncStreamReader<Point> requestStream, ServerCallContext context)
{ {
int pointCount = 0; int pointCount = 0;
int featureCount = 0; int featureCount = 0;
@ -117,7 +118,7 @@ namespace Routeguide
/// Receives a stream of message/location pairs, and responds with a stream of all previous /// Receives a stream of message/location pairs, and responds with a stream of all previous
/// messages at each of those locations. /// messages at each of those locations.
/// </summary> /// </summary>
public async Task RouteChat(Grpc.Core.IAsyncStreamReader<RouteNote> requestStream, Grpc.Core.IServerStreamWriter<RouteNote> responseStream, Grpc.Core.ServerCallContext context) public override async Task RouteChat(IAsyncStreamReader<RouteNote> requestStream, IServerStreamWriter<RouteNote> responseStream, ServerCallContext context)
{ {
while (await requestStream.MoveNext()) while (await requestStream.MoveNext())
{ {

@ -11,7 +11,7 @@
<AssemblyName>RouteGuideServer</AssemblyName> <AssemblyName>RouteGuideServer</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion> <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment> <FileAlignment>512</FileAlignment>
<NuGetPackageImportStamp>164e03eb</NuGetPackageImportStamp> <NuGetPackageImportStamp>d5246467</NuGetPackageImportStamp>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget> <PlatformTarget>AnyCPU</PlatformTarget>
@ -37,9 +37,9 @@
<SpecificVersion>False</SpecificVersion> <SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\Google.Protobuf.3.0.0-beta2\lib\portable-net45+netcore45+wpa81+wp8\Google.Protobuf.dll</HintPath> <HintPath>..\packages\Google.Protobuf.3.0.0-beta2\lib\portable-net45+netcore45+wpa81+wp8\Google.Protobuf.dll</HintPath>
</Reference> </Reference>
<Reference Include="Grpc.Core, Version=0.13.1.0, Culture=neutral, PublicKeyToken=d754f35622e28bad, processorArchitecture=MSIL"> <Reference Include="Grpc.Core, Version=1.0.0.0, Culture=neutral, PublicKeyToken=d754f35622e28bad, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion> <SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\Grpc.Core.0.13.1\lib\net45\Grpc.Core.dll</HintPath> <HintPath>..\packages\Grpc.Core.0.14.0\lib\net45\Grpc.Core.dll</HintPath>
</Reference> </Reference>
<Reference Include="Newtonsoft.Json, Version=7.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL"> <Reference Include="Newtonsoft.Json, Version=7.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion> <SpecificVersion>False</SpecificVersion>
@ -72,12 +72,12 @@
</ProjectReference> </ProjectReference>
</ItemGroup> </ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="..\packages\grpc.native.csharp.0.13.1\build\portable-net45+netcore45+wpa81+wp8\grpc.native.csharp.targets" Condition="Exists('..\packages\grpc.native.csharp.0.13.1\build\portable-net45+netcore45+wpa81+wp8\grpc.native.csharp.targets')" /> <Import Project="..\packages\Grpc.Core.0.14.0\build\net45\Grpc.Core.targets" Condition="Exists('..\packages\Grpc.Core.0.14.0\build\net45\Grpc.Core.targets')" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild"> <Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup> <PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText> <ErrorText>This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup> </PropertyGroup>
<Error Condition="!Exists('..\packages\grpc.native.csharp.0.13.1\build\portable-net45+netcore45+wpa81+wp8\grpc.native.csharp.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\grpc.native.csharp.0.13.1\build\portable-net45+netcore45+wpa81+wp8\grpc.native.csharp.targets'))" /> <Error Condition="!Exists('..\packages\Grpc.Core.0.14.0\build\net45\Grpc.Core.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Grpc.Core.0.14.0\build\net45\Grpc.Core.targets'))" />
</Target> </Target>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it. <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets. Other similar extension points exist, see Microsoft.Common.targets.

@ -1,9 +1,8 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<packages> <packages>
<package id="Google.Protobuf" version="3.0.0-beta2" targetFramework="net45" /> <package id="Google.Protobuf" version="3.0.0-beta2" targetFramework="net45" />
<package id="Grpc" version="0.13.1" targetFramework="net45" /> <package id="Grpc" version="0.14.0" targetFramework="net45" />
<package id="Grpc.Core" version="0.13.1" targetFramework="net45" /> <package id="Grpc.Core" version="0.14.0" targetFramework="net45" />
<package id="grpc.native.csharp" version="0.13.1" targetFramework="net45" />
<package id="Ix-Async" version="1.2.5" targetFramework="net45" /> <package id="Ix-Async" version="1.2.5" targetFramework="net45" />
<package id="Newtonsoft.Json" version="7.0.1" targetFramework="net45" /> <package id="Newtonsoft.Json" version="7.0.1" targetFramework="net45" />
</packages> </packages>

@ -34,7 +34,7 @@ setlocal
@rem enter this directory @rem enter this directory
cd /d %~dp0 cd /d %~dp0
set TOOLS_PATH=packages\Grpc.Tools.0.13.1\tools\windows_x86 set TOOLS_PATH=packages\Grpc.Tools.0.14.0\tools\windows_x86
%TOOLS_PATH%\protoc.exe -I../../protos --csharp_out RouteGuide ../../protos/route_guide.proto --grpc_out RouteGuide --plugin=protoc-gen-grpc=%TOOLS_PATH%\grpc_csharp_plugin.exe %TOOLS_PATH%\protoc.exe -I../../protos --csharp_out RouteGuide ../../protos/route_guide.proto --grpc_out RouteGuide --plugin=protoc-gen-grpc=%TOOLS_PATH%\grpc_csharp_plugin.exe

@ -10,7 +10,7 @@
<email>grpc-packages@google.com</email> <email>grpc-packages@google.com</email>
<active>yes</active> <active>yes</active>
</lead> </lead>
<date>2016-04-19</date> <date>2016-05-19</date>
<time>16:06:07</time> <time>16:06:07</time>
<version> <version>
<release>0.15.0</release> <release>0.15.0</release>
@ -22,7 +22,7 @@
</stability> </stability>
<license>BSD</license> <license>BSD</license>
<notes> <notes>
- destroy grpc_byte_buffer after startBatch #6096 - TBD
</notes> </notes>
<contents> <contents>
<dir baseinstalldir="/" name="/"> <dir baseinstalldir="/" name="/">
@ -1042,8 +1042,8 @@ Update to wrap gRPC C Core version 0.10.0
</release> </release>
<release> <release>
<version> <version>
<release>0.15.0</release> <release>0.14.0</release>
<api>0.15.0</api> <api>0.14.0</api>
</version> </version>
<stability> <stability>
<release>beta</release> <release>beta</release>
@ -1055,5 +1055,35 @@ Update to wrap gRPC C Core version 0.10.0
- destroy grpc_byte_buffer after startBatch #6096 - destroy grpc_byte_buffer after startBatch #6096
</notes> </notes>
</release> </release>
<release>
<version>
<release>0.14.2</release>
<api>0.14.2</api>
</version>
<stability>
<release>beta</release>
<api>beta</api>
</stability>
<date>2016-05-18</date>
<license>BSD</license>
<notes>
- Updated functions with TSRM macros for ZTS support #6607
</notes>
</release>
<release>
<version>
<release>0.15.0</release>
<api>0.15.0</api>
</version>
<stability>
<release>beta</release>
<api>beta</api>
</stability>
<date>2016-05-19</date>
<license>BSD</license>
<notes>
- TBD
</notes>
</release>
</changelog> </changelog>
</package> </package>

@ -37,7 +37,7 @@
<ItemGroup> <ItemGroup>
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="Google.Protobuf"> <Reference Include="Google.Protobuf">
<HintPath>..\packages\Google.Protobuf.3.0.0-beta2\lib\portable-net45+netcore45+wpa81+wp8\Google.Protobuf.dll</HintPath> <HintPath>..\packages\Google.Protobuf.3.0.0-beta3\lib\portable-net45+netcore45+wpa81+wp8\Google.Protobuf.dll</HintPath>
</Reference> </Reference>
<Reference Include="nunit.framework"> <Reference Include="nunit.framework">
<HintPath>..\packages\NUnit.3.2.0\lib\net45\nunit.framework.dll</HintPath> <HintPath>..\packages\NUnit.3.2.0\lib\net45\nunit.framework.dll</HintPath>

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<packages> <packages>
<package id="Google.Protobuf" version="3.0.0-beta2" targetFramework="net45" /> <package id="Google.Protobuf" version="3.0.0-beta3" targetFramework="net45" />
<package id="Ix-Async" version="1.2.5" targetFramework="net45" /> <package id="Ix-Async" version="1.2.5" targetFramework="net45" />
<package id="NUnit" version="3.2.0" targetFramework="net45" /> <package id="NUnit" version="3.2.0" targetFramework="net45" />
<package id="NUnitLite" version="3.2.0" targetFramework="net45" /> <package id="NUnitLite" version="3.2.0" targetFramework="net45" />

@ -39,7 +39,7 @@
<ItemGroup> <ItemGroup>
<Reference Include="Google.Protobuf, Version=3.0.0.0, Culture=neutral, PublicKeyToken=a7d26565bac4d604, processorArchitecture=MSIL"> <Reference Include="Google.Protobuf, Version=3.0.0.0, Culture=neutral, PublicKeyToken=a7d26565bac4d604, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion> <SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\Google.Protobuf.3.0.0-beta2\lib\portable-net45+netcore45+wpa81+wp8\Google.Protobuf.dll</HintPath> <HintPath>..\packages\Google.Protobuf.3.0.0-beta3\lib\portable-net45+netcore45+wpa81+wp8\Google.Protobuf.dll</HintPath>
</Reference> </Reference>
<Reference Include="nunit.framework"> <Reference Include="nunit.framework">
<HintPath>..\packages\NUnit.3.2.0\lib\net45\nunit.framework.dll</HintPath> <HintPath>..\packages\NUnit.3.2.0\lib\net45\nunit.framework.dll</HintPath>

@ -34,12 +34,12 @@ namespace Math {
"Mw==")); "Mw=="));
descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
new pbr::FileDescriptor[] { }, new pbr::FileDescriptor[] { },
new pbr::GeneratedCodeInfo(null, new pbr::GeneratedCodeInfo[] { new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] {
new pbr::GeneratedCodeInfo(typeof(global::Math.DivArgs), global::Math.DivArgs.Parser, new[]{ "Dividend", "Divisor" }, null, null, null), new pbr::GeneratedClrTypeInfo(typeof(global::Math.DivArgs), global::Math.DivArgs.Parser, new[]{ "Dividend", "Divisor" }, null, null, null),
new pbr::GeneratedCodeInfo(typeof(global::Math.DivReply), global::Math.DivReply.Parser, new[]{ "Quotient", "Remainder" }, null, null, null), new pbr::GeneratedClrTypeInfo(typeof(global::Math.DivReply), global::Math.DivReply.Parser, new[]{ "Quotient", "Remainder" }, null, null, null),
new pbr::GeneratedCodeInfo(typeof(global::Math.FibArgs), global::Math.FibArgs.Parser, new[]{ "Limit" }, null, null, null), new pbr::GeneratedClrTypeInfo(typeof(global::Math.FibArgs), global::Math.FibArgs.Parser, new[]{ "Limit" }, null, null, null),
new pbr::GeneratedCodeInfo(typeof(global::Math.Num), global::Math.Num.Parser, new[]{ "Num_" }, null, null, null), new pbr::GeneratedClrTypeInfo(typeof(global::Math.Num), global::Math.Num.Parser, new[]{ "Num_" }, null, null, null),
new pbr::GeneratedCodeInfo(typeof(global::Math.FibReply), global::Math.FibReply.Parser, new[]{ "Count" }, null, null, null) new pbr::GeneratedClrTypeInfo(typeof(global::Math.FibReply), global::Math.FibReply.Parser, new[]{ "Count" }, null, null, null)
})); }));
} }
#endregion #endregion

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<packages> <packages>
<package id="Google.Protobuf" version="3.0.0-beta2" targetFramework="net45" /> <package id="Google.Protobuf" version="3.0.0-beta3" targetFramework="net45" />
<package id="Ix-Async" version="1.2.5" targetFramework="net45" /> <package id="Ix-Async" version="1.2.5" targetFramework="net45" />
<package id="NUnit" version="3.2.0" targetFramework="net45" /> <package id="NUnit" version="3.2.0" targetFramework="net45" />
</packages> </packages>

@ -45,7 +45,7 @@
<Reference Include="System.Data" /> <Reference Include="System.Data" />
<Reference Include="System.Xml" /> <Reference Include="System.Xml" />
<Reference Include="Google.Protobuf"> <Reference Include="Google.Protobuf">
<HintPath>..\packages\Google.Protobuf.3.0.0-beta2\lib\portable-net45+netcore45+wpa81+wp8\Google.Protobuf.dll</HintPath> <HintPath>..\packages\Google.Protobuf.3.0.0-beta3\lib\portable-net45+netcore45+wpa81+wp8\Google.Protobuf.dll</HintPath>
</Reference> </Reference>
<Reference Include="nunit.framework"> <Reference Include="nunit.framework">
<HintPath>..\packages\NUnit.3.2.0\lib\net45\nunit.framework.dll</HintPath> <HintPath>..\packages\NUnit.3.2.0\lib\net45\nunit.framework.dll</HintPath>

@ -79,16 +79,17 @@ namespace Grpc.HealthCheck.Tests
[Test] [Test]
public void ServiceIsRunning() public void ServiceIsRunning()
{ {
serviceImpl.SetStatus("", HealthCheckResponse.Types.ServingStatus.SERVING); serviceImpl.SetStatus("", HealthCheckResponse.Types.ServingStatus.Serving);
var response = client.Check(new HealthCheckRequest { Service = "" }); var response = client.Check(new HealthCheckRequest { 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(new HealthCheckRequest { Service = "nonexistent.service" })); var ex = Assert.Throws<RpcException>(() => client.Check(new HealthCheckRequest { Service = "nonexistent.service" }));
Assert.AreEqual(StatusCode.NotFound, ex.Status.StatusCode);
} }
// TODO(jtattermusch): add test with timeout once timeouts are supported // TODO(jtattermusch): add test with timeout once timeouts are supported

@ -50,38 +50,39 @@ namespace Grpc.HealthCheck.Tests
public void SetStatus() public void SetStatus()
{ {
var impl = new HealthServiceImpl(); var impl = new HealthServiceImpl();
impl.SetStatus("", HealthCheckResponse.Types.ServingStatus.SERVING); impl.SetStatus("", HealthCheckResponse.Types.ServingStatus.Serving);
Assert.AreEqual(HealthCheckResponse.Types.ServingStatus.SERVING, GetStatusHelper(impl, "")); Assert.AreEqual(HealthCheckResponse.Types.ServingStatus.Serving, GetStatusHelper(impl, ""));
impl.SetStatus("", HealthCheckResponse.Types.ServingStatus.NOT_SERVING); impl.SetStatus("", HealthCheckResponse.Types.ServingStatus.NotServing);
Assert.AreEqual(HealthCheckResponse.Types.ServingStatus.NOT_SERVING, GetStatusHelper(impl, "")); Assert.AreEqual(HealthCheckResponse.Types.ServingStatus.NotServing, GetStatusHelper(impl, ""));
impl.SetStatus("", HealthCheckResponse.Types.ServingStatus.UNKNOWN); impl.SetStatus("", HealthCheckResponse.Types.ServingStatus.Unknown);
Assert.AreEqual(HealthCheckResponse.Types.ServingStatus.UNKNOWN, GetStatusHelper(impl, "")); Assert.AreEqual(HealthCheckResponse.Types.ServingStatus.Unknown, GetStatusHelper(impl, ""));
impl.SetStatus("grpc.test.TestService", HealthCheckResponse.Types.ServingStatus.SERVING); impl.SetStatus("grpc.test.TestService", HealthCheckResponse.Types.ServingStatus.Serving);
Assert.AreEqual(HealthCheckResponse.Types.ServingStatus.SERVING, GetStatusHelper(impl, "grpc.test.TestService")); Assert.AreEqual(HealthCheckResponse.Types.ServingStatus.Serving, GetStatusHelper(impl, "grpc.test.TestService"));
} }
[Test] [Test]
public void ClearStatus() public void ClearStatus()
{ {
var impl = new HealthServiceImpl(); var impl = new HealthServiceImpl();
impl.SetStatus("", HealthCheckResponse.Types.ServingStatus.SERVING); impl.SetStatus("", HealthCheckResponse.Types.ServingStatus.Serving);
impl.SetStatus("grpc.test.TestService", HealthCheckResponse.Types.ServingStatus.UNKNOWN); impl.SetStatus("grpc.test.TestService", HealthCheckResponse.Types.ServingStatus.Unknown);
impl.ClearStatus(""); impl.ClearStatus("");
Assert.Throws(Is.TypeOf(typeof(RpcException)).And.Property("Status").Property("StatusCode").EqualTo(StatusCode.NotFound), () => GetStatusHelper(impl, "")); var ex = Assert.Throws<RpcException>(() => GetStatusHelper(impl, ""));
Assert.AreEqual(HealthCheckResponse.Types.ServingStatus.UNKNOWN, GetStatusHelper(impl, "grpc.test.TestService")); Assert.AreEqual(StatusCode.NotFound, ex.Status.StatusCode);
Assert.AreEqual(HealthCheckResponse.Types.ServingStatus.Unknown, GetStatusHelper(impl, "grpc.test.TestService"));
} }
[Test] [Test]
public void ClearAll() public void ClearAll()
{ {
var impl = new HealthServiceImpl(); var impl = new HealthServiceImpl();
impl.SetStatus("", HealthCheckResponse.Types.ServingStatus.SERVING); impl.SetStatus("", HealthCheckResponse.Types.ServingStatus.Serving);
impl.SetStatus("grpc.test.TestService", HealthCheckResponse.Types.ServingStatus.UNKNOWN); impl.SetStatus("grpc.test.TestService", HealthCheckResponse.Types.ServingStatus.Unknown);
impl.ClearAll(); impl.ClearAll();
Assert.Throws(typeof(RpcException), () => GetStatusHelper(impl, "")); Assert.Throws(typeof(RpcException), () => GetStatusHelper(impl, ""));
@ -92,7 +93,7 @@ namespace Grpc.HealthCheck.Tests
public void NullsRejected() public void NullsRejected()
{ {
var impl = new HealthServiceImpl(); var impl = new HealthServiceImpl();
Assert.Throws(typeof(ArgumentNullException), () => impl.SetStatus(null, HealthCheckResponse.Types.ServingStatus.SERVING)); Assert.Throws(typeof(ArgumentNullException), () => impl.SetStatus(null, HealthCheckResponse.Types.ServingStatus.Serving));
Assert.Throws(typeof(ArgumentNullException), () => impl.ClearStatus(null)); Assert.Throws(typeof(ArgumentNullException), () => impl.ClearStatus(null));
} }

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<packages> <packages>
<package id="Google.Protobuf" version="3.0.0-beta2" targetFramework="net45" /> <package id="Google.Protobuf" version="3.0.0-beta3" targetFramework="net45" />
<package id="NUnit" version="3.2.0" targetFramework="net45" /> <package id="NUnit" version="3.2.0" targetFramework="net45" />
<package id="NUnitLite" version="3.2.0" targetFramework="net45" /> <package id="NUnitLite" version="3.2.0" targetFramework="net45" />
</packages> </packages>

@ -40,7 +40,7 @@
<ItemGroup> <ItemGroup>
<Reference Include="Google.Protobuf, Version=3.0.0.0, Culture=neutral, PublicKeyToken=a7d26565bac4d604, processorArchitecture=MSIL"> <Reference Include="Google.Protobuf, Version=3.0.0.0, Culture=neutral, PublicKeyToken=a7d26565bac4d604, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion> <SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\Google.Protobuf.3.0.0-beta2\lib\portable-net45+netcore45+wpa81+wp8\Google.Protobuf.dll</HintPath> <HintPath>..\packages\Google.Protobuf.3.0.0-beta3\lib\portable-net45+netcore45+wpa81+wp8\Google.Protobuf.dll</HintPath>
</Reference> </Reference>
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="System.Core" /> <Reference Include="System.Core" />

@ -33,9 +33,9 @@ namespace Grpc.Health.V1 {
"Ag5HcnBjLkhlYWx0aC5WMWIGcHJvdG8z")); "Ag5HcnBjLkhlYWx0aC5WMWIGcHJvdG8z"));
descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
new pbr::FileDescriptor[] { }, new pbr::FileDescriptor[] { },
new pbr::GeneratedCodeInfo(null, new pbr::GeneratedCodeInfo[] { new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] {
new pbr::GeneratedCodeInfo(typeof(global::Grpc.Health.V1.HealthCheckRequest), global::Grpc.Health.V1.HealthCheckRequest.Parser, new[]{ "Service" }, null, null, null), new pbr::GeneratedClrTypeInfo(typeof(global::Grpc.Health.V1.HealthCheckRequest), global::Grpc.Health.V1.HealthCheckRequest.Parser, new[]{ "Service" }, null, null, null),
new pbr::GeneratedCodeInfo(typeof(global::Grpc.Health.V1.HealthCheckResponse), global::Grpc.Health.V1.HealthCheckResponse.Parser, new[]{ "Status" }, null, new[]{ typeof(global::Grpc.Health.V1.HealthCheckResponse.Types.ServingStatus) }, null) new pbr::GeneratedClrTypeInfo(typeof(global::Grpc.Health.V1.HealthCheckResponse), global::Grpc.Health.V1.HealthCheckResponse.Parser, new[]{ "Status" }, null, new[]{ typeof(global::Grpc.Health.V1.HealthCheckResponse.Types.ServingStatus) }, null)
})); }));
} }
#endregion #endregion
@ -75,7 +75,7 @@ namespace Grpc.Health.V1 {
public string Service { public string Service {
get { return service_; } get { return service_; }
set { set {
service_ = pb::Preconditions.CheckNotNull(value, "value"); service_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
} }
} }
@ -174,7 +174,7 @@ namespace Grpc.Health.V1 {
/// <summary>Field number for the "status" field.</summary> /// <summary>Field number for the "status" field.</summary>
public const int StatusFieldNumber = 1; public const int StatusFieldNumber = 1;
private global::Grpc.Health.V1.HealthCheckResponse.Types.ServingStatus status_ = global::Grpc.Health.V1.HealthCheckResponse.Types.ServingStatus.UNKNOWN; private global::Grpc.Health.V1.HealthCheckResponse.Types.ServingStatus status_ = 0;
public global::Grpc.Health.V1.HealthCheckResponse.Types.ServingStatus Status { public global::Grpc.Health.V1.HealthCheckResponse.Types.ServingStatus Status {
get { return status_; } get { return status_; }
set { set {
@ -199,7 +199,7 @@ namespace Grpc.Health.V1 {
public override int GetHashCode() { public override int GetHashCode() {
int hash = 1; int hash = 1;
if (Status != global::Grpc.Health.V1.HealthCheckResponse.Types.ServingStatus.UNKNOWN) hash ^= Status.GetHashCode(); if (Status != 0) hash ^= Status.GetHashCode();
return hash; return hash;
} }
@ -208,7 +208,7 @@ namespace Grpc.Health.V1 {
} }
public void WriteTo(pb::CodedOutputStream output) { public void WriteTo(pb::CodedOutputStream output) {
if (Status != global::Grpc.Health.V1.HealthCheckResponse.Types.ServingStatus.UNKNOWN) { if (Status != 0) {
output.WriteRawTag(8); output.WriteRawTag(8);
output.WriteEnum((int) Status); output.WriteEnum((int) Status);
} }
@ -216,7 +216,7 @@ namespace Grpc.Health.V1 {
public int CalculateSize() { public int CalculateSize() {
int size = 0; int size = 0;
if (Status != global::Grpc.Health.V1.HealthCheckResponse.Types.ServingStatus.UNKNOWN) { if (Status != 0) {
size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) Status); size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) Status);
} }
return size; return size;
@ -226,7 +226,7 @@ namespace Grpc.Health.V1 {
if (other == null) { if (other == null) {
return; return;
} }
if (other.Status != global::Grpc.Health.V1.HealthCheckResponse.Types.ServingStatus.UNKNOWN) { if (other.Status != 0) {
Status = other.Status; Status = other.Status;
} }
} }
@ -251,9 +251,9 @@ namespace Grpc.Health.V1 {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
public static partial class Types { public static partial class Types {
public enum ServingStatus { public enum ServingStatus {
UNKNOWN = 0, [pbr::OriginalName("UNKNOWN")] Unknown = 0,
SERVING = 1, [pbr::OriginalName("SERVING")] Serving = 1,
NOT_SERVING = 2, [pbr::OriginalName("NOT_SERVING")] NotServing = 2,
} }
} }

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

@ -272,25 +272,25 @@ namespace Grpc.IntegrationTesting
{ {
if (payloadConfig.PayloadCase == PayloadConfig.PayloadOneofCase.BytebufParams) if (payloadConfig.PayloadCase == PayloadConfig.PayloadOneofCase.BytebufParams)
{ {
GrpcPreconditions.CheckArgument(clientType == ClientType.ASYNC_CLIENT, "Generic client only supports async API"); GrpcPreconditions.CheckArgument(clientType == ClientType.AsyncClient, "Generic client only supports async API");
GrpcPreconditions.CheckArgument(rpcType == RpcType.STREAMING, "Generic client only supports streaming calls"); GrpcPreconditions.CheckArgument(rpcType == RpcType.Streaming, "Generic client only supports streaming calls");
return RunGenericStreamingAsync(channel, timer); return RunGenericStreamingAsync(channel, timer);
} }
GrpcPreconditions.CheckNotNull(payloadConfig.SimpleParams); GrpcPreconditions.CheckNotNull(payloadConfig.SimpleParams);
if (clientType == ClientType.SYNC_CLIENT) if (clientType == ClientType.SyncClient)
{ {
GrpcPreconditions.CheckArgument(rpcType == RpcType.UNARY, "Sync client can only be used for Unary calls in C#"); GrpcPreconditions.CheckArgument(rpcType == RpcType.Unary, "Sync client can only be used for Unary calls in C#");
// create a dedicated thread for the synchronous client // create a dedicated thread for the synchronous client
return Task.Factory.StartNew(() => RunUnary(channel, timer), TaskCreationOptions.LongRunning); return Task.Factory.StartNew(() => RunUnary(channel, timer), TaskCreationOptions.LongRunning);
} }
else if (clientType == ClientType.ASYNC_CLIENT) else if (clientType == ClientType.AsyncClient)
{ {
switch (rpcType) switch (rpcType)
{ {
case RpcType.UNARY: case RpcType.Unary:
return RunUnaryAsync(channel, timer); return RunUnaryAsync(channel, timer);
case RpcType.STREAMING: case RpcType.Streaming:
return RunStreamingPingPongAsync(channel, timer); return RunStreamingPingPongAsync(channel, timer);
} }
} }

@ -85,25 +85,25 @@ namespace Grpc.Testing {
"RUFNSU5HEAFiBnByb3RvMw==")); "RUFNSU5HEAFiBnByb3RvMw=="));
descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
new pbr::FileDescriptor[] { global::Grpc.Testing.PayloadsReflection.Descriptor, global::Grpc.Testing.StatsReflection.Descriptor, }, new pbr::FileDescriptor[] { global::Grpc.Testing.PayloadsReflection.Descriptor, global::Grpc.Testing.StatsReflection.Descriptor, },
new pbr::GeneratedCodeInfo(new[] {typeof(global::Grpc.Testing.ClientType), typeof(global::Grpc.Testing.ServerType), typeof(global::Grpc.Testing.RpcType), }, new pbr::GeneratedCodeInfo[] { new pbr::GeneratedClrTypeInfo(new[] {typeof(global::Grpc.Testing.ClientType), typeof(global::Grpc.Testing.ServerType), typeof(global::Grpc.Testing.RpcType), }, new pbr::GeneratedClrTypeInfo[] {
new pbr::GeneratedCodeInfo(typeof(global::Grpc.Testing.PoissonParams), global::Grpc.Testing.PoissonParams.Parser, new[]{ "OfferedLoad" }, null, null, null), new pbr::GeneratedClrTypeInfo(typeof(global::Grpc.Testing.PoissonParams), global::Grpc.Testing.PoissonParams.Parser, new[]{ "OfferedLoad" }, null, null, null),
new pbr::GeneratedCodeInfo(typeof(global::Grpc.Testing.ClosedLoopParams), global::Grpc.Testing.ClosedLoopParams.Parser, null, null, null, null), new pbr::GeneratedClrTypeInfo(typeof(global::Grpc.Testing.ClosedLoopParams), global::Grpc.Testing.ClosedLoopParams.Parser, null, null, null, null),
new pbr::GeneratedCodeInfo(typeof(global::Grpc.Testing.LoadParams), global::Grpc.Testing.LoadParams.Parser, new[]{ "ClosedLoop", "Poisson" }, new[]{ "Load" }, null, null), new pbr::GeneratedClrTypeInfo(typeof(global::Grpc.Testing.LoadParams), global::Grpc.Testing.LoadParams.Parser, new[]{ "ClosedLoop", "Poisson" }, new[]{ "Load" }, null, null),
new pbr::GeneratedCodeInfo(typeof(global::Grpc.Testing.SecurityParams), global::Grpc.Testing.SecurityParams.Parser, new[]{ "UseTestCa", "ServerHostOverride" }, null, null, null), new pbr::GeneratedClrTypeInfo(typeof(global::Grpc.Testing.SecurityParams), global::Grpc.Testing.SecurityParams.Parser, new[]{ "UseTestCa", "ServerHostOverride" }, null, null, null),
new pbr::GeneratedCodeInfo(typeof(global::Grpc.Testing.ClientConfig), global::Grpc.Testing.ClientConfig.Parser, new[]{ "ServerTargets", "ClientType", "SecurityParams", "OutstandingRpcsPerChannel", "ClientChannels", "AsyncClientThreads", "RpcType", "LoadParams", "PayloadConfig", "HistogramParams", "CoreList", "CoreLimit", "OtherClientApi" }, null, null, null), new pbr::GeneratedClrTypeInfo(typeof(global::Grpc.Testing.ClientConfig), global::Grpc.Testing.ClientConfig.Parser, new[]{ "ServerTargets", "ClientType", "SecurityParams", "OutstandingRpcsPerChannel", "ClientChannels", "AsyncClientThreads", "RpcType", "LoadParams", "PayloadConfig", "HistogramParams", "CoreList", "CoreLimit", "OtherClientApi" }, null, null, null),
new pbr::GeneratedCodeInfo(typeof(global::Grpc.Testing.ClientStatus), global::Grpc.Testing.ClientStatus.Parser, new[]{ "Stats" }, null, null, null), new pbr::GeneratedClrTypeInfo(typeof(global::Grpc.Testing.ClientStatus), global::Grpc.Testing.ClientStatus.Parser, new[]{ "Stats" }, null, null, null),
new pbr::GeneratedCodeInfo(typeof(global::Grpc.Testing.Mark), global::Grpc.Testing.Mark.Parser, new[]{ "Reset" }, null, null, null), new pbr::GeneratedClrTypeInfo(typeof(global::Grpc.Testing.Mark), global::Grpc.Testing.Mark.Parser, new[]{ "Reset" }, null, null, null),
new pbr::GeneratedCodeInfo(typeof(global::Grpc.Testing.ClientArgs), global::Grpc.Testing.ClientArgs.Parser, new[]{ "Setup", "Mark" }, new[]{ "Argtype" }, null, null), new pbr::GeneratedClrTypeInfo(typeof(global::Grpc.Testing.ClientArgs), global::Grpc.Testing.ClientArgs.Parser, new[]{ "Setup", "Mark" }, new[]{ "Argtype" }, null, null),
new pbr::GeneratedCodeInfo(typeof(global::Grpc.Testing.ServerConfig), global::Grpc.Testing.ServerConfig.Parser, new[]{ "ServerType", "SecurityParams", "Port", "AsyncServerThreads", "CoreLimit", "PayloadConfig", "CoreList", "OtherServerApi" }, null, null, null), new pbr::GeneratedClrTypeInfo(typeof(global::Grpc.Testing.ServerConfig), global::Grpc.Testing.ServerConfig.Parser, new[]{ "ServerType", "SecurityParams", "Port", "AsyncServerThreads", "CoreLimit", "PayloadConfig", "CoreList", "OtherServerApi" }, null, null, null),
new pbr::GeneratedCodeInfo(typeof(global::Grpc.Testing.ServerArgs), global::Grpc.Testing.ServerArgs.Parser, new[]{ "Setup", "Mark" }, new[]{ "Argtype" }, null, null), new pbr::GeneratedClrTypeInfo(typeof(global::Grpc.Testing.ServerArgs), global::Grpc.Testing.ServerArgs.Parser, new[]{ "Setup", "Mark" }, new[]{ "Argtype" }, null, null),
new pbr::GeneratedCodeInfo(typeof(global::Grpc.Testing.ServerStatus), global::Grpc.Testing.ServerStatus.Parser, new[]{ "Stats", "Port", "Cores" }, null, null, null), new pbr::GeneratedClrTypeInfo(typeof(global::Grpc.Testing.ServerStatus), global::Grpc.Testing.ServerStatus.Parser, new[]{ "Stats", "Port", "Cores" }, null, null, null),
new pbr::GeneratedCodeInfo(typeof(global::Grpc.Testing.CoreRequest), global::Grpc.Testing.CoreRequest.Parser, null, null, null, null), new pbr::GeneratedClrTypeInfo(typeof(global::Grpc.Testing.CoreRequest), global::Grpc.Testing.CoreRequest.Parser, null, null, null, null),
new pbr::GeneratedCodeInfo(typeof(global::Grpc.Testing.CoreResponse), global::Grpc.Testing.CoreResponse.Parser, new[]{ "Cores" }, null, null, null), new pbr::GeneratedClrTypeInfo(typeof(global::Grpc.Testing.CoreResponse), global::Grpc.Testing.CoreResponse.Parser, new[]{ "Cores" }, null, null, null),
new pbr::GeneratedCodeInfo(typeof(global::Grpc.Testing.Void), global::Grpc.Testing.Void.Parser, null, null, null, null), new pbr::GeneratedClrTypeInfo(typeof(global::Grpc.Testing.Void), global::Grpc.Testing.Void.Parser, null, null, null, null),
new pbr::GeneratedCodeInfo(typeof(global::Grpc.Testing.Scenario), global::Grpc.Testing.Scenario.Parser, new[]{ "Name", "ClientConfig", "NumClients", "ServerConfig", "NumServers", "WarmupSeconds", "BenchmarkSeconds", "SpawnLocalWorkerCount" }, null, null, null), new pbr::GeneratedClrTypeInfo(typeof(global::Grpc.Testing.Scenario), global::Grpc.Testing.Scenario.Parser, new[]{ "Name", "ClientConfig", "NumClients", "ServerConfig", "NumServers", "WarmupSeconds", "BenchmarkSeconds", "SpawnLocalWorkerCount" }, null, null, null),
new pbr::GeneratedCodeInfo(typeof(global::Grpc.Testing.Scenarios), global::Grpc.Testing.Scenarios.Parser, new[]{ "Scenarios_" }, null, null, null), new pbr::GeneratedClrTypeInfo(typeof(global::Grpc.Testing.Scenarios), global::Grpc.Testing.Scenarios.Parser, new[]{ "Scenarios_" }, null, null, null),
new pbr::GeneratedCodeInfo(typeof(global::Grpc.Testing.ScenarioResultSummary), global::Grpc.Testing.ScenarioResultSummary.Parser, new[]{ "Qps", "QpsPerServerCore", "ServerSystemTime", "ServerUserTime", "ClientSystemTime", "ClientUserTime", "Latency50", "Latency90", "Latency95", "Latency99", "Latency999" }, null, null, null), new pbr::GeneratedClrTypeInfo(typeof(global::Grpc.Testing.ScenarioResultSummary), global::Grpc.Testing.ScenarioResultSummary.Parser, new[]{ "Qps", "QpsPerServerCore", "ServerSystemTime", "ServerUserTime", "ClientSystemTime", "ClientUserTime", "Latency50", "Latency90", "Latency95", "Latency99", "Latency999" }, null, null, null),
new pbr::GeneratedCodeInfo(typeof(global::Grpc.Testing.ScenarioResult), global::Grpc.Testing.ScenarioResult.Parser, new[]{ "Scenario", "Latencies", "ClientStats", "ServerStats", "ServerCores", "Summary" }, null, null, null) new pbr::GeneratedClrTypeInfo(typeof(global::Grpc.Testing.ScenarioResult), global::Grpc.Testing.ScenarioResult.Parser, new[]{ "Scenario", "Latencies", "ClientStats", "ServerStats", "ServerCores", "Summary" }, null, null, null)
})); }));
} }
#endregion #endregion
@ -115,27 +115,27 @@ namespace Grpc.Testing {
/// Many languages support a basic distinction between using /// Many languages support a basic distinction between using
/// sync or async client, and this allows the specification /// sync or async client, and this allows the specification
/// </summary> /// </summary>
SYNC_CLIENT = 0, [pbr::OriginalName("SYNC_CLIENT")] SyncClient = 0,
ASYNC_CLIENT = 1, [pbr::OriginalName("ASYNC_CLIENT")] AsyncClient = 1,
/// <summary> /// <summary>
/// used for some language-specific variants /// used for some language-specific variants
/// </summary> /// </summary>
OTHER_CLIENT = 2, [pbr::OriginalName("OTHER_CLIENT")] OtherClient = 2,
} }
public enum ServerType { public enum ServerType {
SYNC_SERVER = 0, [pbr::OriginalName("SYNC_SERVER")] SyncServer = 0,
ASYNC_SERVER = 1, [pbr::OriginalName("ASYNC_SERVER")] AsyncServer = 1,
ASYNC_GENERIC_SERVER = 2, [pbr::OriginalName("ASYNC_GENERIC_SERVER")] AsyncGenericServer = 2,
/// <summary> /// <summary>
/// used for some language-specific variants /// used for some language-specific variants
/// </summary> /// </summary>
OTHER_SERVER = 3, [pbr::OriginalName("OTHER_SERVER")] OtherServer = 3,
} }
public enum RpcType { public enum RpcType {
UNARY = 0, [pbr::OriginalName("UNARY")] Unary = 0,
STREAMING = 1, [pbr::OriginalName("STREAMING")] Streaming = 1,
} }
#endregion #endregion
@ -547,7 +547,7 @@ namespace Grpc.Testing {
public string ServerHostOverride { public string ServerHostOverride {
get { return serverHostOverride_; } get { return serverHostOverride_; }
set { set {
serverHostOverride_ = pb::Preconditions.CheckNotNull(value, "value"); serverHostOverride_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
} }
} }
@ -686,7 +686,7 @@ namespace Grpc.Testing {
/// <summary>Field number for the "client_type" field.</summary> /// <summary>Field number for the "client_type" field.</summary>
public const int ClientTypeFieldNumber = 2; public const int ClientTypeFieldNumber = 2;
private global::Grpc.Testing.ClientType clientType_ = global::Grpc.Testing.ClientType.SYNC_CLIENT; private global::Grpc.Testing.ClientType clientType_ = 0;
public global::Grpc.Testing.ClientType ClientType { public global::Grpc.Testing.ClientType ClientType {
get { return clientType_; } get { return clientType_; }
set { set {
@ -747,7 +747,7 @@ namespace Grpc.Testing {
/// <summary>Field number for the "rpc_type" field.</summary> /// <summary>Field number for the "rpc_type" field.</summary>
public const int RpcTypeFieldNumber = 8; public const int RpcTypeFieldNumber = 8;
private global::Grpc.Testing.RpcType rpcType_ = global::Grpc.Testing.RpcType.UNARY; private global::Grpc.Testing.RpcType rpcType_ = 0;
public global::Grpc.Testing.RpcType RpcType { public global::Grpc.Testing.RpcType RpcType {
get { return rpcType_; } get { return rpcType_; }
set { set {
@ -819,7 +819,7 @@ namespace Grpc.Testing {
public string OtherClientApi { public string OtherClientApi {
get { return otherClientApi_; } get { return otherClientApi_; }
set { set {
otherClientApi_ = pb::Preconditions.CheckNotNull(value, "value"); otherClientApi_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
} }
} }
@ -853,12 +853,12 @@ namespace Grpc.Testing {
public override int GetHashCode() { public override int GetHashCode() {
int hash = 1; int hash = 1;
hash ^= serverTargets_.GetHashCode(); hash ^= serverTargets_.GetHashCode();
if (ClientType != global::Grpc.Testing.ClientType.SYNC_CLIENT) hash ^= ClientType.GetHashCode(); if (ClientType != 0) hash ^= ClientType.GetHashCode();
if (securityParams_ != null) hash ^= SecurityParams.GetHashCode(); if (securityParams_ != null) hash ^= SecurityParams.GetHashCode();
if (OutstandingRpcsPerChannel != 0) hash ^= OutstandingRpcsPerChannel.GetHashCode(); if (OutstandingRpcsPerChannel != 0) hash ^= OutstandingRpcsPerChannel.GetHashCode();
if (ClientChannels != 0) hash ^= ClientChannels.GetHashCode(); if (ClientChannels != 0) hash ^= ClientChannels.GetHashCode();
if (AsyncClientThreads != 0) hash ^= AsyncClientThreads.GetHashCode(); if (AsyncClientThreads != 0) hash ^= AsyncClientThreads.GetHashCode();
if (RpcType != global::Grpc.Testing.RpcType.UNARY) hash ^= RpcType.GetHashCode(); if (RpcType != 0) hash ^= RpcType.GetHashCode();
if (loadParams_ != null) hash ^= LoadParams.GetHashCode(); if (loadParams_ != null) hash ^= LoadParams.GetHashCode();
if (payloadConfig_ != null) hash ^= PayloadConfig.GetHashCode(); if (payloadConfig_ != null) hash ^= PayloadConfig.GetHashCode();
if (histogramParams_ != null) hash ^= HistogramParams.GetHashCode(); if (histogramParams_ != null) hash ^= HistogramParams.GetHashCode();
@ -874,7 +874,7 @@ namespace Grpc.Testing {
public void WriteTo(pb::CodedOutputStream output) { public void WriteTo(pb::CodedOutputStream output) {
serverTargets_.WriteTo(output, _repeated_serverTargets_codec); serverTargets_.WriteTo(output, _repeated_serverTargets_codec);
if (ClientType != global::Grpc.Testing.ClientType.SYNC_CLIENT) { if (ClientType != 0) {
output.WriteRawTag(16); output.WriteRawTag(16);
output.WriteEnum((int) ClientType); output.WriteEnum((int) ClientType);
} }
@ -894,7 +894,7 @@ namespace Grpc.Testing {
output.WriteRawTag(56); output.WriteRawTag(56);
output.WriteInt32(AsyncClientThreads); output.WriteInt32(AsyncClientThreads);
} }
if (RpcType != global::Grpc.Testing.RpcType.UNARY) { if (RpcType != 0) {
output.WriteRawTag(64); output.WriteRawTag(64);
output.WriteEnum((int) RpcType); output.WriteEnum((int) RpcType);
} }
@ -924,7 +924,7 @@ namespace Grpc.Testing {
public int CalculateSize() { public int CalculateSize() {
int size = 0; int size = 0;
size += serverTargets_.CalculateSize(_repeated_serverTargets_codec); size += serverTargets_.CalculateSize(_repeated_serverTargets_codec);
if (ClientType != global::Grpc.Testing.ClientType.SYNC_CLIENT) { if (ClientType != 0) {
size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) ClientType); size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) ClientType);
} }
if (securityParams_ != null) { if (securityParams_ != null) {
@ -939,7 +939,7 @@ namespace Grpc.Testing {
if (AsyncClientThreads != 0) { if (AsyncClientThreads != 0) {
size += 1 + pb::CodedOutputStream.ComputeInt32Size(AsyncClientThreads); size += 1 + pb::CodedOutputStream.ComputeInt32Size(AsyncClientThreads);
} }
if (RpcType != global::Grpc.Testing.RpcType.UNARY) { if (RpcType != 0) {
size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) RpcType); size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) RpcType);
} }
if (loadParams_ != null) { if (loadParams_ != null) {
@ -966,7 +966,7 @@ namespace Grpc.Testing {
return; return;
} }
serverTargets_.Add(other.serverTargets_); serverTargets_.Add(other.serverTargets_);
if (other.ClientType != global::Grpc.Testing.ClientType.SYNC_CLIENT) { if (other.ClientType != 0) {
ClientType = other.ClientType; ClientType = other.ClientType;
} }
if (other.securityParams_ != null) { if (other.securityParams_ != null) {
@ -984,7 +984,7 @@ namespace Grpc.Testing {
if (other.AsyncClientThreads != 0) { if (other.AsyncClientThreads != 0) {
AsyncClientThreads = other.AsyncClientThreads; AsyncClientThreads = other.AsyncClientThreads;
} }
if (other.RpcType != global::Grpc.Testing.RpcType.UNARY) { if (other.RpcType != 0) {
RpcType = other.RpcType; RpcType = other.RpcType;
} }
if (other.loadParams_ != null) { if (other.loadParams_ != null) {
@ -1515,7 +1515,7 @@ namespace Grpc.Testing {
/// <summary>Field number for the "server_type" field.</summary> /// <summary>Field number for the "server_type" field.</summary>
public const int ServerTypeFieldNumber = 1; public const int ServerTypeFieldNumber = 1;
private global::Grpc.Testing.ServerType serverType_ = global::Grpc.Testing.ServerType.SYNC_SERVER; private global::Grpc.Testing.ServerType serverType_ = 0;
public global::Grpc.Testing.ServerType ServerType { public global::Grpc.Testing.ServerType ServerType {
get { return serverType_; } get { return serverType_; }
set { set {
@ -1606,7 +1606,7 @@ namespace Grpc.Testing {
public string OtherServerApi { public string OtherServerApi {
get { return otherServerApi_; } get { return otherServerApi_; }
set { set {
otherServerApi_ = pb::Preconditions.CheckNotNull(value, "value"); otherServerApi_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
} }
} }
@ -1634,7 +1634,7 @@ namespace Grpc.Testing {
public override int GetHashCode() { public override int GetHashCode() {
int hash = 1; int hash = 1;
if (ServerType != global::Grpc.Testing.ServerType.SYNC_SERVER) hash ^= ServerType.GetHashCode(); if (ServerType != 0) hash ^= ServerType.GetHashCode();
if (securityParams_ != null) hash ^= SecurityParams.GetHashCode(); if (securityParams_ != null) hash ^= SecurityParams.GetHashCode();
if (Port != 0) hash ^= Port.GetHashCode(); if (Port != 0) hash ^= Port.GetHashCode();
if (AsyncServerThreads != 0) hash ^= AsyncServerThreads.GetHashCode(); if (AsyncServerThreads != 0) hash ^= AsyncServerThreads.GetHashCode();
@ -1650,7 +1650,7 @@ namespace Grpc.Testing {
} }
public void WriteTo(pb::CodedOutputStream output) { public void WriteTo(pb::CodedOutputStream output) {
if (ServerType != global::Grpc.Testing.ServerType.SYNC_SERVER) { if (ServerType != 0) {
output.WriteRawTag(8); output.WriteRawTag(8);
output.WriteEnum((int) ServerType); output.WriteEnum((int) ServerType);
} }
@ -1683,7 +1683,7 @@ namespace Grpc.Testing {
public int CalculateSize() { public int CalculateSize() {
int size = 0; int size = 0;
if (ServerType != global::Grpc.Testing.ServerType.SYNC_SERVER) { if (ServerType != 0) {
size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) ServerType); size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) ServerType);
} }
if (securityParams_ != null) { if (securityParams_ != null) {
@ -1712,7 +1712,7 @@ namespace Grpc.Testing {
if (other == null) { if (other == null) {
return; return;
} }
if (other.ServerType != global::Grpc.Testing.ServerType.SYNC_SERVER) { if (other.ServerType != 0) {
ServerType = other.ServerType; ServerType = other.ServerType;
} }
if (other.securityParams_ != null) { if (other.securityParams_ != null) {
@ -2436,7 +2436,7 @@ namespace Grpc.Testing {
public string Name { public string Name {
get { return name_; } get { return name_; }
set { set {
name_ = pb::Preconditions.CheckNotNull(value, "value"); name_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
} }
} }

@ -27,8 +27,8 @@ namespace Grpc.Testing {
"c3RpbmciBwoFRW1wdHliBnByb3RvMw==")); "c3RpbmciBwoFRW1wdHliBnByb3RvMw=="));
descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
new pbr::FileDescriptor[] { }, new pbr::FileDescriptor[] { },
new pbr::GeneratedCodeInfo(null, new pbr::GeneratedCodeInfo[] { new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] {
new pbr::GeneratedCodeInfo(typeof(global::Grpc.Testing.Empty), global::Grpc.Testing.Empty.Parser, null, null, null, null) new pbr::GeneratedClrTypeInfo(typeof(global::Grpc.Testing.Empty), global::Grpc.Testing.Empty.Parser, null, null, null, null)
})); }));
} }
#endregion #endregion

@ -61,7 +61,7 @@
<HintPath>..\packages\Google.Apis.Core.1.11.1\lib\net45\Google.Apis.Core.dll</HintPath> <HintPath>..\packages\Google.Apis.Core.1.11.1\lib\net45\Google.Apis.Core.dll</HintPath>
</Reference> </Reference>
<Reference Include="Google.Protobuf"> <Reference Include="Google.Protobuf">
<HintPath>..\packages\Google.Protobuf.3.0.0-beta2\lib\portable-net45+netcore45+wpa81+wp8\Google.Protobuf.dll</HintPath> <HintPath>..\packages\Google.Protobuf.3.0.0-beta3\lib\portable-net45+netcore45+wpa81+wp8\Google.Protobuf.dll</HintPath>
</Reference> </Reference>
<Reference Include="Newtonsoft.Json"> <Reference Include="Newtonsoft.Json">
<HintPath>..\packages\Newtonsoft.Json.7.0.1\lib\net45\Newtonsoft.Json.dll</HintPath> <HintPath>..\packages\Newtonsoft.Json.7.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>

@ -230,13 +230,13 @@ namespace Grpc.IntegrationTesting
Console.WriteLine("running large_unary"); Console.WriteLine("running large_unary");
var request = new SimpleRequest var request = new SimpleRequest
{ {
ResponseType = PayloadType.COMPRESSABLE, ResponseType = PayloadType.Compressable,
ResponseSize = 314159, ResponseSize = 314159,
Payload = CreateZerosPayload(271828) Payload = CreateZerosPayload(271828)
}; };
var response = client.UnaryCall(request); var response = client.UnaryCall(request);
Assert.AreEqual(PayloadType.COMPRESSABLE, response.Payload.Type); Assert.AreEqual(PayloadType.Compressable, response.Payload.Type);
Assert.AreEqual(314159, response.Payload.Body.Length); Assert.AreEqual(314159, response.Payload.Body.Length);
Console.WriteLine("Passed!"); Console.WriteLine("Passed!");
} }
@ -265,7 +265,7 @@ namespace Grpc.IntegrationTesting
var request = new StreamingOutputCallRequest var request = new StreamingOutputCallRequest
{ {
ResponseType = PayloadType.COMPRESSABLE, ResponseType = PayloadType.Compressable,
ResponseParameters = { bodySizes.ConvertAll((size) => new ResponseParameters { Size = size }) } ResponseParameters = { bodySizes.ConvertAll((size) => new ResponseParameters { Size = size }) }
}; };
@ -274,7 +274,7 @@ namespace Grpc.IntegrationTesting
var responseList = await call.ResponseStream.ToListAsync(); var responseList = await call.ResponseStream.ToListAsync();
foreach (var res in responseList) foreach (var res in responseList)
{ {
Assert.AreEqual(PayloadType.COMPRESSABLE, res.Payload.Type); Assert.AreEqual(PayloadType.Compressable, res.Payload.Type);
} }
CollectionAssert.AreEqual(bodySizes, responseList.ConvertAll((item) => item.Payload.Body.Length)); CollectionAssert.AreEqual(bodySizes, responseList.ConvertAll((item) => item.Payload.Body.Length));
} }
@ -289,46 +289,46 @@ namespace Grpc.IntegrationTesting
{ {
await call.RequestStream.WriteAsync(new StreamingOutputCallRequest await call.RequestStream.WriteAsync(new StreamingOutputCallRequest
{ {
ResponseType = PayloadType.COMPRESSABLE, ResponseType = PayloadType.Compressable,
ResponseParameters = { new ResponseParameters { Size = 31415 } }, ResponseParameters = { new ResponseParameters { Size = 31415 } },
Payload = CreateZerosPayload(27182) 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(new StreamingOutputCallRequest await call.RequestStream.WriteAsync(new StreamingOutputCallRequest
{ {
ResponseType = PayloadType.COMPRESSABLE, ResponseType = PayloadType.Compressable,
ResponseParameters = { new ResponseParameters { Size = 9 } }, ResponseParameters = { new ResponseParameters { Size = 9 } },
Payload = CreateZerosPayload(8) 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(new StreamingOutputCallRequest await call.RequestStream.WriteAsync(new StreamingOutputCallRequest
{ {
ResponseType = PayloadType.COMPRESSABLE, ResponseType = PayloadType.Compressable,
ResponseParameters = { new ResponseParameters { Size = 2653 } }, ResponseParameters = { new ResponseParameters { Size = 2653 } },
Payload = CreateZerosPayload(1828) 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(new StreamingOutputCallRequest await call.RequestStream.WriteAsync(new StreamingOutputCallRequest
{ {
ResponseType = PayloadType.COMPRESSABLE, ResponseType = PayloadType.Compressable,
ResponseParameters = { new ResponseParameters { Size = 58979 } }, ResponseParameters = { new ResponseParameters { Size = 58979 } },
Payload = CreateZerosPayload(45904) 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);
Assert.AreEqual(58979, call.ResponseStream.Current.Payload.Body.Length); Assert.AreEqual(58979, call.ResponseStream.Current.Payload.Body.Length);
await call.RequestStream.CompleteAsync(); await call.RequestStream.CompleteAsync();
@ -357,7 +357,7 @@ namespace Grpc.IntegrationTesting
var request = new SimpleRequest var request = new SimpleRequest
{ {
ResponseType = PayloadType.COMPRESSABLE, ResponseType = PayloadType.Compressable,
ResponseSize = 314159, ResponseSize = 314159,
Payload = CreateZerosPayload(271828), Payload = CreateZerosPayload(271828),
FillUsername = true, FillUsername = true,
@ -367,7 +367,7 @@ namespace Grpc.IntegrationTesting
// not setting credentials here because they were set on channel already // not setting credentials here because they were set on channel already
var response = client.UnaryCall(request); var response = client.UnaryCall(request);
Assert.AreEqual(PayloadType.COMPRESSABLE, response.Payload.Type); Assert.AreEqual(PayloadType.Compressable, response.Payload.Type);
Assert.AreEqual(314159, response.Payload.Body.Length); Assert.AreEqual(314159, response.Payload.Body.Length);
Assert.False(string.IsNullOrEmpty(response.OauthScope)); Assert.False(string.IsNullOrEmpty(response.OauthScope));
Assert.True(oauthScope.Contains(response.OauthScope)); Assert.True(oauthScope.Contains(response.OauthScope));
@ -381,7 +381,7 @@ namespace Grpc.IntegrationTesting
var request = new SimpleRequest var request = new SimpleRequest
{ {
ResponseType = PayloadType.COMPRESSABLE, ResponseType = PayloadType.Compressable,
ResponseSize = 314159, ResponseSize = 314159,
Payload = CreateZerosPayload(271828), Payload = CreateZerosPayload(271828),
FillUsername = true, FillUsername = true,
@ -390,7 +390,7 @@ namespace Grpc.IntegrationTesting
// not setting credentials here because they were set on channel already // not setting credentials here because they were set on channel already
var response = client.UnaryCall(request); var response = client.UnaryCall(request);
Assert.AreEqual(PayloadType.COMPRESSABLE, response.Payload.Type); Assert.AreEqual(PayloadType.Compressable, response.Payload.Type);
Assert.AreEqual(314159, response.Payload.Body.Length); Assert.AreEqual(314159, response.Payload.Body.Length);
Assert.AreEqual(GetEmailFromServiceAccountFile(), response.Username); Assert.AreEqual(GetEmailFromServiceAccountFile(), response.Username);
Console.WriteLine("Passed!"); Console.WriteLine("Passed!");
@ -460,13 +460,13 @@ namespace Grpc.IntegrationTesting
{ {
await call.RequestStream.WriteAsync(new StreamingOutputCallRequest await call.RequestStream.WriteAsync(new StreamingOutputCallRequest
{ {
ResponseType = PayloadType.COMPRESSABLE, ResponseType = PayloadType.Compressable,
ResponseParameters = { new ResponseParameters { Size = 31415 } }, ResponseParameters = { new ResponseParameters { Size = 31415 } },
Payload = CreateZerosPayload(27182) 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);
cts.Cancel(); cts.Cancel();
@ -511,7 +511,7 @@ namespace Grpc.IntegrationTesting
// step 1: test unary call // step 1: test unary call
var request = new SimpleRequest var request = new SimpleRequest
{ {
ResponseType = PayloadType.COMPRESSABLE, ResponseType = PayloadType.Compressable,
ResponseSize = 314159, ResponseSize = 314159,
Payload = CreateZerosPayload(271828) Payload = CreateZerosPayload(271828)
}; };
@ -530,7 +530,7 @@ namespace Grpc.IntegrationTesting
// step 2: test full duplex call // step 2: test full duplex call
var request = new StreamingOutputCallRequest var request = new StreamingOutputCallRequest
{ {
ResponseType = PayloadType.COMPRESSABLE, ResponseType = PayloadType.Compressable,
ResponseParameters = { new ResponseParameters { Size = 31415 } }, ResponseParameters = { new ResponseParameters { Size = 31415 } },
Payload = CreateZerosPayload(27182) Payload = CreateZerosPayload(27182)
}; };

@ -55,18 +55,18 @@ namespace Grpc.Testing {
"TkUQABIICgRHWklQEAESCwoHREVGTEFURRACYgZwcm90bzM=")); "TkUQABIICgRHWklQEAESCwoHREVGTEFURRACYgZwcm90bzM="));
descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
new pbr::FileDescriptor[] { }, new pbr::FileDescriptor[] { },
new pbr::GeneratedCodeInfo(new[] {typeof(global::Grpc.Testing.PayloadType), typeof(global::Grpc.Testing.CompressionType), }, new pbr::GeneratedCodeInfo[] { new pbr::GeneratedClrTypeInfo(new[] {typeof(global::Grpc.Testing.PayloadType), typeof(global::Grpc.Testing.CompressionType), }, new pbr::GeneratedClrTypeInfo[] {
new pbr::GeneratedCodeInfo(typeof(global::Grpc.Testing.Payload), global::Grpc.Testing.Payload.Parser, new[]{ "Type", "Body" }, null, null, null), new pbr::GeneratedClrTypeInfo(typeof(global::Grpc.Testing.Payload), global::Grpc.Testing.Payload.Parser, new[]{ "Type", "Body" }, null, null, null),
new pbr::GeneratedCodeInfo(typeof(global::Grpc.Testing.EchoStatus), global::Grpc.Testing.EchoStatus.Parser, new[]{ "Code", "Message" }, null, null, null), new pbr::GeneratedClrTypeInfo(typeof(global::Grpc.Testing.EchoStatus), global::Grpc.Testing.EchoStatus.Parser, new[]{ "Code", "Message" }, null, null, null),
new pbr::GeneratedCodeInfo(typeof(global::Grpc.Testing.SimpleRequest), global::Grpc.Testing.SimpleRequest.Parser, new[]{ "ResponseType", "ResponseSize", "Payload", "FillUsername", "FillOauthScope", "ResponseCompression", "ResponseStatus" }, null, null, null), new pbr::GeneratedClrTypeInfo(typeof(global::Grpc.Testing.SimpleRequest), global::Grpc.Testing.SimpleRequest.Parser, new[]{ "ResponseType", "ResponseSize", "Payload", "FillUsername", "FillOauthScope", "ResponseCompression", "ResponseStatus" }, null, null, null),
new pbr::GeneratedCodeInfo(typeof(global::Grpc.Testing.SimpleResponse), global::Grpc.Testing.SimpleResponse.Parser, new[]{ "Payload", "Username", "OauthScope" }, null, null, null), new pbr::GeneratedClrTypeInfo(typeof(global::Grpc.Testing.SimpleResponse), global::Grpc.Testing.SimpleResponse.Parser, new[]{ "Payload", "Username", "OauthScope" }, null, null, null),
new pbr::GeneratedCodeInfo(typeof(global::Grpc.Testing.StreamingInputCallRequest), global::Grpc.Testing.StreamingInputCallRequest.Parser, new[]{ "Payload" }, null, null, null), new pbr::GeneratedClrTypeInfo(typeof(global::Grpc.Testing.StreamingInputCallRequest), global::Grpc.Testing.StreamingInputCallRequest.Parser, new[]{ "Payload" }, null, null, null),
new pbr::GeneratedCodeInfo(typeof(global::Grpc.Testing.StreamingInputCallResponse), global::Grpc.Testing.StreamingInputCallResponse.Parser, new[]{ "AggregatedPayloadSize" }, null, null, null), new pbr::GeneratedClrTypeInfo(typeof(global::Grpc.Testing.StreamingInputCallResponse), global::Grpc.Testing.StreamingInputCallResponse.Parser, new[]{ "AggregatedPayloadSize" }, null, null, null),
new pbr::GeneratedCodeInfo(typeof(global::Grpc.Testing.ResponseParameters), global::Grpc.Testing.ResponseParameters.Parser, new[]{ "Size", "IntervalUs" }, null, null, null), new pbr::GeneratedClrTypeInfo(typeof(global::Grpc.Testing.ResponseParameters), global::Grpc.Testing.ResponseParameters.Parser, new[]{ "Size", "IntervalUs" }, null, null, null),
new pbr::GeneratedCodeInfo(typeof(global::Grpc.Testing.StreamingOutputCallRequest), global::Grpc.Testing.StreamingOutputCallRequest.Parser, new[]{ "ResponseType", "ResponseParameters", "Payload", "ResponseCompression", "ResponseStatus" }, null, null, null), new pbr::GeneratedClrTypeInfo(typeof(global::Grpc.Testing.StreamingOutputCallRequest), global::Grpc.Testing.StreamingOutputCallRequest.Parser, new[]{ "ResponseType", "ResponseParameters", "Payload", "ResponseCompression", "ResponseStatus" }, null, null, null),
new pbr::GeneratedCodeInfo(typeof(global::Grpc.Testing.StreamingOutputCallResponse), global::Grpc.Testing.StreamingOutputCallResponse.Parser, new[]{ "Payload" }, null, null, null), new pbr::GeneratedClrTypeInfo(typeof(global::Grpc.Testing.StreamingOutputCallResponse), global::Grpc.Testing.StreamingOutputCallResponse.Parser, new[]{ "Payload" }, null, null, null),
new pbr::GeneratedCodeInfo(typeof(global::Grpc.Testing.ReconnectParams), global::Grpc.Testing.ReconnectParams.Parser, new[]{ "MaxReconnectBackoffMs" }, null, null, null), new pbr::GeneratedClrTypeInfo(typeof(global::Grpc.Testing.ReconnectParams), global::Grpc.Testing.ReconnectParams.Parser, new[]{ "MaxReconnectBackoffMs" }, null, null, null),
new pbr::GeneratedCodeInfo(typeof(global::Grpc.Testing.ReconnectInfo), global::Grpc.Testing.ReconnectInfo.Parser, new[]{ "Passed", "BackoffMs" }, null, null, null) new pbr::GeneratedClrTypeInfo(typeof(global::Grpc.Testing.ReconnectInfo), global::Grpc.Testing.ReconnectInfo.Parser, new[]{ "Passed", "BackoffMs" }, null, null, null)
})); }));
} }
#endregion #endregion
@ -80,15 +80,15 @@ namespace Grpc.Testing {
/// <summary> /// <summary>
/// Compressable text format. /// Compressable text format.
/// </summary> /// </summary>
COMPRESSABLE = 0, [pbr::OriginalName("COMPRESSABLE")] Compressable = 0,
/// <summary> /// <summary>
/// Uncompressable binary format. /// Uncompressable binary format.
/// </summary> /// </summary>
UNCOMPRESSABLE = 1, [pbr::OriginalName("UNCOMPRESSABLE")] Uncompressable = 1,
/// <summary> /// <summary>
/// Randomly chosen from all other formats defined in this enum. /// Randomly chosen from all other formats defined in this enum.
/// </summary> /// </summary>
RANDOM = 2, [pbr::OriginalName("RANDOM")] Random = 2,
} }
/// <summary> /// <summary>
@ -98,9 +98,9 @@ namespace Grpc.Testing {
/// <summary> /// <summary>
/// No compression /// No compression
/// </summary> /// </summary>
NONE = 0, [pbr::OriginalName("NONE")] None = 0,
GZIP = 1, [pbr::OriginalName("GZIP")] Gzip = 1,
DEFLATE = 2, [pbr::OriginalName("DEFLATE")] Deflate = 2,
} }
#endregion #endregion
@ -139,7 +139,7 @@ namespace Grpc.Testing {
/// <summary>Field number for the "type" field.</summary> /// <summary>Field number for the "type" field.</summary>
public const int TypeFieldNumber = 1; public const int TypeFieldNumber = 1;
private global::Grpc.Testing.PayloadType type_ = global::Grpc.Testing.PayloadType.COMPRESSABLE; private global::Grpc.Testing.PayloadType type_ = 0;
/// <summary> /// <summary>
/// The type of data in body. /// The type of data in body.
/// </summary> /// </summary>
@ -159,7 +159,7 @@ namespace Grpc.Testing {
public pb::ByteString Body { public pb::ByteString Body {
get { return body_; } get { return body_; }
set { set {
body_ = pb::Preconditions.CheckNotNull(value, "value"); body_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
} }
} }
@ -181,7 +181,7 @@ namespace Grpc.Testing {
public override int GetHashCode() { public override int GetHashCode() {
int hash = 1; int hash = 1;
if (Type != global::Grpc.Testing.PayloadType.COMPRESSABLE) hash ^= Type.GetHashCode(); if (Type != 0) hash ^= Type.GetHashCode();
if (Body.Length != 0) hash ^= Body.GetHashCode(); if (Body.Length != 0) hash ^= Body.GetHashCode();
return hash; return hash;
} }
@ -191,7 +191,7 @@ namespace Grpc.Testing {
} }
public void WriteTo(pb::CodedOutputStream output) { public void WriteTo(pb::CodedOutputStream output) {
if (Type != global::Grpc.Testing.PayloadType.COMPRESSABLE) { if (Type != 0) {
output.WriteRawTag(8); output.WriteRawTag(8);
output.WriteEnum((int) Type); output.WriteEnum((int) Type);
} }
@ -203,7 +203,7 @@ namespace Grpc.Testing {
public int CalculateSize() { public int CalculateSize() {
int size = 0; int size = 0;
if (Type != global::Grpc.Testing.PayloadType.COMPRESSABLE) { if (Type != 0) {
size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) Type); size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) Type);
} }
if (Body.Length != 0) { if (Body.Length != 0) {
@ -216,7 +216,7 @@ namespace Grpc.Testing {
if (other == null) { if (other == null) {
return; return;
} }
if (other.Type != global::Grpc.Testing.PayloadType.COMPRESSABLE) { if (other.Type != 0) {
Type = other.Type; Type = other.Type;
} }
if (other.Body.Length != 0) { if (other.Body.Length != 0) {
@ -293,7 +293,7 @@ namespace Grpc.Testing {
public string Message { public string Message {
get { return message_; } get { return message_; }
set { set {
message_ = pb::Preconditions.CheckNotNull(value, "value"); message_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
} }
} }
@ -417,7 +417,7 @@ namespace Grpc.Testing {
/// <summary>Field number for the "response_type" field.</summary> /// <summary>Field number for the "response_type" field.</summary>
public const int ResponseTypeFieldNumber = 1; public const int ResponseTypeFieldNumber = 1;
private global::Grpc.Testing.PayloadType responseType_ = global::Grpc.Testing.PayloadType.COMPRESSABLE; private global::Grpc.Testing.PayloadType responseType_ = 0;
/// <summary> /// <summary>
/// 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.
@ -484,7 +484,7 @@ namespace Grpc.Testing {
/// <summary>Field number for the "response_compression" field.</summary> /// <summary>Field number for the "response_compression" field.</summary>
public const int ResponseCompressionFieldNumber = 6; public const int ResponseCompressionFieldNumber = 6;
private global::Grpc.Testing.CompressionType responseCompression_ = global::Grpc.Testing.CompressionType.NONE; private global::Grpc.Testing.CompressionType responseCompression_ = 0;
/// <summary> /// <summary>
/// Compression algorithm to be used by the server for the response (stream) /// Compression algorithm to be used by the server for the response (stream)
/// </summary> /// </summary>
@ -531,12 +531,12 @@ namespace Grpc.Testing {
public override int GetHashCode() { public override int GetHashCode() {
int hash = 1; int hash = 1;
if (ResponseType != global::Grpc.Testing.PayloadType.COMPRESSABLE) hash ^= ResponseType.GetHashCode(); if (ResponseType != 0) hash ^= ResponseType.GetHashCode();
if (ResponseSize != 0) hash ^= ResponseSize.GetHashCode(); if (ResponseSize != 0) hash ^= ResponseSize.GetHashCode();
if (payload_ != null) hash ^= Payload.GetHashCode(); if (payload_ != null) hash ^= Payload.GetHashCode();
if (FillUsername != false) hash ^= FillUsername.GetHashCode(); if (FillUsername != false) hash ^= FillUsername.GetHashCode();
if (FillOauthScope != false) hash ^= FillOauthScope.GetHashCode(); if (FillOauthScope != false) hash ^= FillOauthScope.GetHashCode();
if (ResponseCompression != global::Grpc.Testing.CompressionType.NONE) hash ^= ResponseCompression.GetHashCode(); if (ResponseCompression != 0) hash ^= ResponseCompression.GetHashCode();
if (responseStatus_ != null) hash ^= ResponseStatus.GetHashCode(); if (responseStatus_ != null) hash ^= ResponseStatus.GetHashCode();
return hash; return hash;
} }
@ -546,7 +546,7 @@ namespace Grpc.Testing {
} }
public void WriteTo(pb::CodedOutputStream output) { public void WriteTo(pb::CodedOutputStream output) {
if (ResponseType != global::Grpc.Testing.PayloadType.COMPRESSABLE) { if (ResponseType != 0) {
output.WriteRawTag(8); output.WriteRawTag(8);
output.WriteEnum((int) ResponseType); output.WriteEnum((int) ResponseType);
} }
@ -566,7 +566,7 @@ namespace Grpc.Testing {
output.WriteRawTag(40); output.WriteRawTag(40);
output.WriteBool(FillOauthScope); output.WriteBool(FillOauthScope);
} }
if (ResponseCompression != global::Grpc.Testing.CompressionType.NONE) { if (ResponseCompression != 0) {
output.WriteRawTag(48); output.WriteRawTag(48);
output.WriteEnum((int) ResponseCompression); output.WriteEnum((int) ResponseCompression);
} }
@ -578,7 +578,7 @@ namespace Grpc.Testing {
public int CalculateSize() { public int CalculateSize() {
int size = 0; int size = 0;
if (ResponseType != global::Grpc.Testing.PayloadType.COMPRESSABLE) { if (ResponseType != 0) {
size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) ResponseType); size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) ResponseType);
} }
if (ResponseSize != 0) { if (ResponseSize != 0) {
@ -593,7 +593,7 @@ namespace Grpc.Testing {
if (FillOauthScope != false) { if (FillOauthScope != false) {
size += 1 + 1; size += 1 + 1;
} }
if (ResponseCompression != global::Grpc.Testing.CompressionType.NONE) { if (ResponseCompression != 0) {
size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) ResponseCompression); size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) ResponseCompression);
} }
if (responseStatus_ != null) { if (responseStatus_ != null) {
@ -606,7 +606,7 @@ namespace Grpc.Testing {
if (other == null) { if (other == null) {
return; return;
} }
if (other.ResponseType != global::Grpc.Testing.PayloadType.COMPRESSABLE) { if (other.ResponseType != 0) {
ResponseType = other.ResponseType; ResponseType = other.ResponseType;
} }
if (other.ResponseSize != 0) { if (other.ResponseSize != 0) {
@ -624,7 +624,7 @@ namespace Grpc.Testing {
if (other.FillOauthScope != false) { if (other.FillOauthScope != false) {
FillOauthScope = other.FillOauthScope; FillOauthScope = other.FillOauthScope;
} }
if (other.ResponseCompression != global::Grpc.Testing.CompressionType.NONE) { if (other.ResponseCompression != 0) {
ResponseCompression = other.ResponseCompression; ResponseCompression = other.ResponseCompression;
} }
if (other.responseStatus_ != null) { if (other.responseStatus_ != null) {
@ -737,7 +737,7 @@ namespace Grpc.Testing {
public string Username { public string Username {
get { return username_; } get { return username_; }
set { set {
username_ = pb::Preconditions.CheckNotNull(value, "value"); username_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
} }
} }
@ -750,7 +750,7 @@ namespace Grpc.Testing {
public string OauthScope { public string OauthScope {
get { return oauthScope_; } get { return oauthScope_; }
set { set {
oauthScope_ = pb::Preconditions.CheckNotNull(value, "value"); oauthScope_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
} }
} }
@ -1259,7 +1259,7 @@ namespace Grpc.Testing {
/// <summary>Field number for the "response_type" field.</summary> /// <summary>Field number for the "response_type" field.</summary>
public const int ResponseTypeFieldNumber = 1; public const int ResponseTypeFieldNumber = 1;
private global::Grpc.Testing.PayloadType responseType_ = global::Grpc.Testing.PayloadType.COMPRESSABLE; private global::Grpc.Testing.PayloadType responseType_ = 0;
/// <summary> /// <summary>
/// Desired payload type in the response from the server. /// Desired payload type in the response from the server.
/// 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
@ -1300,7 +1300,7 @@ namespace Grpc.Testing {
/// <summary>Field number for the "response_compression" field.</summary> /// <summary>Field number for the "response_compression" field.</summary>
public const int ResponseCompressionFieldNumber = 6; public const int ResponseCompressionFieldNumber = 6;
private global::Grpc.Testing.CompressionType responseCompression_ = global::Grpc.Testing.CompressionType.NONE; private global::Grpc.Testing.CompressionType responseCompression_ = 0;
/// <summary> /// <summary>
/// Compression algorithm to be used by the server for the response (stream) /// Compression algorithm to be used by the server for the response (stream)
/// </summary> /// </summary>
@ -1345,10 +1345,10 @@ namespace Grpc.Testing {
public override int GetHashCode() { public override int GetHashCode() {
int hash = 1; int hash = 1;
if (ResponseType != global::Grpc.Testing.PayloadType.COMPRESSABLE) hash ^= ResponseType.GetHashCode(); if (ResponseType != 0) hash ^= ResponseType.GetHashCode();
hash ^= responseParameters_.GetHashCode(); hash ^= responseParameters_.GetHashCode();
if (payload_ != null) hash ^= Payload.GetHashCode(); if (payload_ != null) hash ^= Payload.GetHashCode();
if (ResponseCompression != global::Grpc.Testing.CompressionType.NONE) hash ^= ResponseCompression.GetHashCode(); if (ResponseCompression != 0) hash ^= ResponseCompression.GetHashCode();
if (responseStatus_ != null) hash ^= ResponseStatus.GetHashCode(); if (responseStatus_ != null) hash ^= ResponseStatus.GetHashCode();
return hash; return hash;
} }
@ -1358,7 +1358,7 @@ namespace Grpc.Testing {
} }
public void WriteTo(pb::CodedOutputStream output) { public void WriteTo(pb::CodedOutputStream output) {
if (ResponseType != global::Grpc.Testing.PayloadType.COMPRESSABLE) { if (ResponseType != 0) {
output.WriteRawTag(8); output.WriteRawTag(8);
output.WriteEnum((int) ResponseType); output.WriteEnum((int) ResponseType);
} }
@ -1367,7 +1367,7 @@ namespace Grpc.Testing {
output.WriteRawTag(26); output.WriteRawTag(26);
output.WriteMessage(Payload); output.WriteMessage(Payload);
} }
if (ResponseCompression != global::Grpc.Testing.CompressionType.NONE) { if (ResponseCompression != 0) {
output.WriteRawTag(48); output.WriteRawTag(48);
output.WriteEnum((int) ResponseCompression); output.WriteEnum((int) ResponseCompression);
} }
@ -1379,14 +1379,14 @@ namespace Grpc.Testing {
public int CalculateSize() { public int CalculateSize() {
int size = 0; int size = 0;
if (ResponseType != global::Grpc.Testing.PayloadType.COMPRESSABLE) { if (ResponseType != 0) {
size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) ResponseType); size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) ResponseType);
} }
size += responseParameters_.CalculateSize(_repeated_responseParameters_codec); size += responseParameters_.CalculateSize(_repeated_responseParameters_codec);
if (payload_ != null) { if (payload_ != null) {
size += 1 + pb::CodedOutputStream.ComputeMessageSize(Payload); size += 1 + pb::CodedOutputStream.ComputeMessageSize(Payload);
} }
if (ResponseCompression != global::Grpc.Testing.CompressionType.NONE) { if (ResponseCompression != 0) {
size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) ResponseCompression); size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) ResponseCompression);
} }
if (responseStatus_ != null) { if (responseStatus_ != null) {
@ -1399,7 +1399,7 @@ namespace Grpc.Testing {
if (other == null) { if (other == null) {
return; return;
} }
if (other.ResponseType != global::Grpc.Testing.PayloadType.COMPRESSABLE) { if (other.ResponseType != 0) {
ResponseType = other.ResponseType; ResponseType = other.ResponseType;
} }
responseParameters_.Add(other.responseParameters_); responseParameters_.Add(other.responseParameters_);
@ -1409,7 +1409,7 @@ namespace Grpc.Testing {
} }
Payload.MergeFrom(other.Payload); Payload.MergeFrom(other.Payload);
} }
if (other.ResponseCompression != global::Grpc.Testing.CompressionType.NONE) { if (other.ResponseCompression != 0) {
ResponseCompression = other.ResponseCompression; ResponseCompression = other.ResponseCompression;
} }
if (other.responseStatus_ != null) { if (other.responseStatus_ != null) {

@ -34,10 +34,10 @@ namespace Grpc.Testing {
"dWdlUmVzcG9uc2ViBnByb3RvMw==")); "dWdlUmVzcG9uc2ViBnByb3RvMw=="));
descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
new pbr::FileDescriptor[] { }, new pbr::FileDescriptor[] { },
new pbr::GeneratedCodeInfo(null, new pbr::GeneratedCodeInfo[] { new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] {
new pbr::GeneratedCodeInfo(typeof(global::Grpc.Testing.GaugeResponse), global::Grpc.Testing.GaugeResponse.Parser, new[]{ "Name", "LongValue", "DoubleValue", "StringValue" }, new[]{ "Value" }, null, null), new pbr::GeneratedClrTypeInfo(typeof(global::Grpc.Testing.GaugeResponse), global::Grpc.Testing.GaugeResponse.Parser, new[]{ "Name", "LongValue", "DoubleValue", "StringValue" }, new[]{ "Value" }, null, null),
new pbr::GeneratedCodeInfo(typeof(global::Grpc.Testing.GaugeRequest), global::Grpc.Testing.GaugeRequest.Parser, new[]{ "Name" }, null, null, null), new pbr::GeneratedClrTypeInfo(typeof(global::Grpc.Testing.GaugeRequest), global::Grpc.Testing.GaugeRequest.Parser, new[]{ "Name" }, null, null, null),
new pbr::GeneratedCodeInfo(typeof(global::Grpc.Testing.EmptyMessage), global::Grpc.Testing.EmptyMessage.Parser, null, null, null, null) new pbr::GeneratedClrTypeInfo(typeof(global::Grpc.Testing.EmptyMessage), global::Grpc.Testing.EmptyMessage.Parser, null, null, null, null)
})); }));
} }
#endregion #endregion
@ -92,7 +92,7 @@ namespace Grpc.Testing {
public string Name { public string Name {
get { return name_; } get { return name_; }
set { set {
name_ = pb::Preconditions.CheckNotNull(value, "value"); name_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
} }
} }
@ -121,7 +121,7 @@ namespace Grpc.Testing {
public string StringValue { public string StringValue {
get { return valueCase_ == ValueOneofCase.StringValue ? (string) value_ : ""; } get { return valueCase_ == ValueOneofCase.StringValue ? (string) value_ : ""; }
set { set {
value_ = pb::Preconditions.CheckNotNull(value, "value"); value_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
valueCase_ = ValueOneofCase.StringValue; valueCase_ = ValueOneofCase.StringValue;
} }
} }
@ -299,7 +299,7 @@ namespace Grpc.Testing {
public string Name { public string Name {
get { return name_; } get { return name_; }
set { set {
name_ = pb::Preconditions.CheckNotNull(value, "value"); name_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
} }
} }

@ -34,11 +34,11 @@ namespace Grpc.Testing {
"aW5nLkNvbXBsZXhQcm90b1BhcmFtc0gAQgkKB3BheWxvYWRiBnByb3RvMw==")); "aW5nLkNvbXBsZXhQcm90b1BhcmFtc0gAQgkKB3BheWxvYWRiBnByb3RvMw=="));
descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
new pbr::FileDescriptor[] { }, new pbr::FileDescriptor[] { },
new pbr::GeneratedCodeInfo(null, new pbr::GeneratedCodeInfo[] { new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] {
new pbr::GeneratedCodeInfo(typeof(global::Grpc.Testing.ByteBufferParams), global::Grpc.Testing.ByteBufferParams.Parser, new[]{ "ReqSize", "RespSize" }, null, null, null), new pbr::GeneratedClrTypeInfo(typeof(global::Grpc.Testing.ByteBufferParams), global::Grpc.Testing.ByteBufferParams.Parser, new[]{ "ReqSize", "RespSize" }, null, null, null),
new pbr::GeneratedCodeInfo(typeof(global::Grpc.Testing.SimpleProtoParams), global::Grpc.Testing.SimpleProtoParams.Parser, new[]{ "ReqSize", "RespSize" }, null, null, null), new pbr::GeneratedClrTypeInfo(typeof(global::Grpc.Testing.SimpleProtoParams), global::Grpc.Testing.SimpleProtoParams.Parser, new[]{ "ReqSize", "RespSize" }, null, null, null),
new pbr::GeneratedCodeInfo(typeof(global::Grpc.Testing.ComplexProtoParams), global::Grpc.Testing.ComplexProtoParams.Parser, null, null, null, null), new pbr::GeneratedClrTypeInfo(typeof(global::Grpc.Testing.ComplexProtoParams), global::Grpc.Testing.ComplexProtoParams.Parser, null, null, null, null),
new pbr::GeneratedCodeInfo(typeof(global::Grpc.Testing.PayloadConfig), global::Grpc.Testing.PayloadConfig.Parser, new[]{ "BytebufParams", "SimpleParams", "ComplexParams" }, new[]{ "Payload" }, null, null) new pbr::GeneratedClrTypeInfo(typeof(global::Grpc.Testing.PayloadConfig), global::Grpc.Testing.PayloadConfig.Parser, new[]{ "BytebufParams", "SimpleParams", "ComplexParams" }, new[]{ "Payload" }, null, null)
})); }));
} }
#endregion #endregion

@ -55,7 +55,7 @@ namespace Grpc.IntegrationTesting
{ {
var serverConfig = new ServerConfig var serverConfig = new ServerConfig
{ {
ServerType = ServerType.ASYNC_SERVER ServerType = ServerType.AsyncServer
}; };
serverRunner = ServerRunners.CreateStarted(serverConfig); serverRunner = ServerRunners.CreateStarted(serverConfig);
} }
@ -75,7 +75,7 @@ namespace Grpc.IntegrationTesting
var config = new ClientConfig var config = new ClientConfig
{ {
ServerTargets = { string.Format("{0}:{1}", "localhost", serverRunner.BoundPort) }, ServerTargets = { string.Format("{0}:{1}", "localhost", serverRunner.BoundPort) },
RpcType = RpcType.UNARY, RpcType = RpcType.Unary,
LoadParams = new LoadParams { ClosedLoop = new ClosedLoopParams() }, LoadParams = new LoadParams { ClosedLoop = new ClosedLoopParams() },
PayloadConfig = new PayloadConfig PayloadConfig = new PayloadConfig
{ {

@ -77,13 +77,13 @@ namespace Grpc.IntegrationTesting
} }
ServerServiceDefinition service = null; ServerServiceDefinition service = null;
if (config.ServerType == ServerType.ASYNC_SERVER) if (config.ServerType == ServerType.AsyncServer)
{ {
GrpcPreconditions.CheckArgument(config.PayloadConfig == null, GrpcPreconditions.CheckArgument(config.PayloadConfig == null,
"ServerConfig.PayloadConfig shouldn't be set for BenchmarkService based server."); "ServerConfig.PayloadConfig shouldn't be set for BenchmarkService based server.");
service = BenchmarkService.BindService(new BenchmarkServiceImpl()); service = BenchmarkService.BindService(new BenchmarkServiceImpl());
} }
else if (config.ServerType == ServerType.ASYNC_GENERIC_SERVER) else if (config.ServerType == ServerType.AsyncGenericServer)
{ {
var genericService = new GenericServiceImpl(config.PayloadConfig.BytebufParams.RespSize); var genericService = new GenericServiceImpl(config.PayloadConfig.BytebufParams.RespSize);
service = GenericService.BindHandler(genericService.StreamingCall); service = GenericService.BindHandler(genericService.StreamingCall);

@ -39,7 +39,7 @@ namespace Grpc.Testing {
"YgZwcm90bzM=")); "YgZwcm90bzM="));
descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
new pbr::FileDescriptor[] { global::Grpc.Testing.MessagesReflection.Descriptor, global::Grpc.Testing.ControlReflection.Descriptor, }, new pbr::FileDescriptor[] { global::Grpc.Testing.MessagesReflection.Descriptor, global::Grpc.Testing.ControlReflection.Descriptor, },
new pbr::GeneratedCodeInfo(null, null)); new pbr::GeneratedClrTypeInfo(null, null));
} }
#endregion #endregion

@ -35,11 +35,11 @@ namespace Grpc.Testing {
"ZXIYAyABKAESEwoLdGltZV9zeXN0ZW0YBCABKAFiBnByb3RvMw==")); "ZXIYAyABKAESEwoLdGltZV9zeXN0ZW0YBCABKAFiBnByb3RvMw=="));
descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
new pbr::FileDescriptor[] { }, new pbr::FileDescriptor[] { },
new pbr::GeneratedCodeInfo(null, new pbr::GeneratedCodeInfo[] { new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] {
new pbr::GeneratedCodeInfo(typeof(global::Grpc.Testing.ServerStats), global::Grpc.Testing.ServerStats.Parser, new[]{ "TimeElapsed", "TimeUser", "TimeSystem" }, null, null, null), new pbr::GeneratedClrTypeInfo(typeof(global::Grpc.Testing.ServerStats), global::Grpc.Testing.ServerStats.Parser, new[]{ "TimeElapsed", "TimeUser", "TimeSystem" }, null, null, null),
new pbr::GeneratedCodeInfo(typeof(global::Grpc.Testing.HistogramParams), global::Grpc.Testing.HistogramParams.Parser, new[]{ "Resolution", "MaxPossible" }, null, null, null), new pbr::GeneratedClrTypeInfo(typeof(global::Grpc.Testing.HistogramParams), global::Grpc.Testing.HistogramParams.Parser, new[]{ "Resolution", "MaxPossible" }, null, null, null),
new pbr::GeneratedCodeInfo(typeof(global::Grpc.Testing.HistogramData), global::Grpc.Testing.HistogramData.Parser, new[]{ "Bucket", "MinSeen", "MaxSeen", "Sum", "SumOfSquares", "Count" }, null, null, null), new pbr::GeneratedClrTypeInfo(typeof(global::Grpc.Testing.HistogramData), global::Grpc.Testing.HistogramData.Parser, new[]{ "Bucket", "MinSeen", "MaxSeen", "Sum", "SumOfSquares", "Count" }, null, null, null),
new pbr::GeneratedCodeInfo(typeof(global::Grpc.Testing.ClientStats), global::Grpc.Testing.ClientStats.Parser, new[]{ "Latencies", "TimeElapsed", "TimeUser", "TimeSystem" }, null, null, null) new pbr::GeneratedClrTypeInfo(typeof(global::Grpc.Testing.ClientStats), global::Grpc.Testing.ClientStats.Parser, new[]{ "Latencies", "TimeElapsed", "TimeUser", "TimeSystem" }, null, null, null)
})); }));
} }
#endregion #endregion

@ -46,7 +46,7 @@ namespace Grpc.Testing {
"cnBjLnRlc3RpbmcuUmVjb25uZWN0SW5mb2IGcHJvdG8z")); "cnBjLnRlc3RpbmcuUmVjb25uZWN0SW5mb2IGcHJvdG8z"));
descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
new pbr::FileDescriptor[] { global::Grpc.Testing.EmptyReflection.Descriptor, global::Grpc.Testing.MessagesReflection.Descriptor, }, new pbr::FileDescriptor[] { global::Grpc.Testing.EmptyReflection.Descriptor, global::Grpc.Testing.MessagesReflection.Descriptor, },
new pbr::GeneratedCodeInfo(null, null)); new pbr::GeneratedClrTypeInfo(null, null));
} }
#endregion #endregion

@ -4,7 +4,7 @@
<package id="CommandLineParser" version="1.9.71" targetFramework="net45" /> <package id="CommandLineParser" version="1.9.71" targetFramework="net45" />
<package id="Google.Apis.Auth" version="1.11.1" targetFramework="net45" /> <package id="Google.Apis.Auth" version="1.11.1" targetFramework="net45" />
<package id="Google.Apis.Core" version="1.11.1" targetFramework="net45" /> <package id="Google.Apis.Core" version="1.11.1" targetFramework="net45" />
<package id="Google.Protobuf" version="3.0.0-beta2" targetFramework="net45" /> <package id="Google.Protobuf" version="3.0.0-beta3" targetFramework="net45" />
<package id="Ix-Async" version="1.2.5" targetFramework="net45" /> <package id="Ix-Async" version="1.2.5" targetFramework="net45" />
<package id="Moq" version="4.2.1510.2205" targetFramework="net45" /> <package id="Moq" version="4.2.1510.2205" targetFramework="net45" />
<package id="Newtonsoft.Json" version="7.0.1" targetFramework="net45" /> <package id="Newtonsoft.Json" version="7.0.1" targetFramework="net45" />

@ -31,7 +31,7 @@
@rem Current package versions @rem Current package versions
set VERSION=0.15.0-dev set VERSION=0.15.0-dev
set PROTOBUF_VERSION=3.0.0-beta2 set PROTOBUF_VERSION=3.0.0-beta3
@rem Packages that depend on prerelease packages (like Google.Protobuf) need to have prerelease suffix as well. @rem Packages that depend on prerelease packages (like Google.Protobuf) need to have prerelease suffix as well.
set VERSION_WITH_BETA=%VERSION%-beta set VERSION_WITH_BETA=%VERSION%-beta

@ -52,21 +52,41 @@ typedef struct next_call_stack {
grpc_event event; grpc_event event;
gpr_timespec timeout; gpr_timespec timeout;
void *tag; void *tag;
volatile int interrupted;
} next_call_stack; } next_call_stack;
/* Calls grpc_completion_queue_next without holding the ruby GIL */ /* Calls grpc_completion_queue_next without holding the ruby GIL */
static void *grpc_rb_completion_queue_next_no_gil(void *param) { static void *grpc_rb_completion_queue_next_no_gil(void *param) {
next_call_stack *const next_call = (next_call_stack*)param; next_call_stack *const next_call = (next_call_stack*)param;
next_call->event = gpr_timespec increment = gpr_time_from_millis(20, GPR_TIMESPAN);
grpc_completion_queue_next(next_call->cq, next_call->timeout, NULL); gpr_timespec deadline;
do {
deadline = gpr_time_add(gpr_now(GPR_CLOCK_REALTIME), increment);
next_call->event = grpc_completion_queue_next(next_call->cq,
deadline, NULL);
if (next_call->event.type != GRPC_QUEUE_TIMEOUT ||
gpr_time_cmp(deadline, next_call->timeout) > 0) {
break;
}
} while (!next_call->interrupted);
return NULL; return NULL;
} }
/* Calls grpc_completion_queue_pluck without holding the ruby GIL */ /* Calls grpc_completion_queue_pluck without holding the ruby GIL */
static void *grpc_rb_completion_queue_pluck_no_gil(void *param) { static void *grpc_rb_completion_queue_pluck_no_gil(void *param) {
next_call_stack *const next_call = (next_call_stack*)param; next_call_stack *const next_call = (next_call_stack*)param;
next_call->event = grpc_completion_queue_pluck(next_call->cq, next_call->tag, gpr_timespec increment = gpr_time_from_millis(20, GPR_TIMESPAN);
next_call->timeout, NULL); gpr_timespec deadline;
do {
deadline = gpr_time_add(gpr_now(GPR_CLOCK_REALTIME), increment);
next_call->event = grpc_completion_queue_pluck(next_call->cq,
next_call->tag,
deadline, NULL);
if (next_call->event.type != GRPC_QUEUE_TIMEOUT ||
gpr_time_cmp(deadline, next_call->timeout) > 0) {
break;
}
} while (!next_call->interrupted);
return NULL; return NULL;
} }
@ -139,6 +159,11 @@ static VALUE grpc_rb_completion_queue_alloc(VALUE cls) {
return TypedData_Wrap_Struct(cls, &grpc_rb_completion_queue_data_type, cq); return TypedData_Wrap_Struct(cls, &grpc_rb_completion_queue_data_type, cq);
} }
static void unblock_func(void *param) {
next_call_stack *const next_call = (next_call_stack*)param;
next_call->interrupted = 1;
}
/* Blocks until the next event for given tag is available, and returns the /* Blocks until the next event for given tag is available, and returns the
* event. */ * event. */
grpc_event grpc_rb_completion_queue_pluck_event(VALUE self, VALUE tag, grpc_event grpc_rb_completion_queue_pluck_event(VALUE self, VALUE tag,
@ -158,8 +183,23 @@ grpc_event grpc_rb_completion_queue_pluck_event(VALUE self, VALUE tag,
next_call.tag = ROBJECT(tag); next_call.tag = ROBJECT(tag);
} }
next_call.event.type = GRPC_QUEUE_TIMEOUT; next_call.event.type = GRPC_QUEUE_TIMEOUT;
/* Loop until we finish a pluck without an interruption. The internal
pluck function runs either until it is interrupted or it gets an
event, or time runs out.
The basic reason we need this relatively complicated construction is that
we need to re-acquire the GVL when an interrupt comes in, so that the ruby
interpreter can do what it needs to do with the interrupt. But we also need
to get back to plucking when the interrupt has been handled. */
do {
next_call.interrupted = 0;
rb_thread_call_without_gvl(grpc_rb_completion_queue_pluck_no_gil, rb_thread_call_without_gvl(grpc_rb_completion_queue_pluck_no_gil,
(void *)&next_call, NULL, NULL); (void *)&next_call, unblock_func,
(void *)&next_call);
/* If an interrupt prevented pluck from returning useful information, then
any plucks that did complete must have timed out */
} while (next_call.interrupted &&
next_call.event.type == GRPC_QUEUE_TIMEOUT);
return next_call.event; return next_call.event;
} }

@ -46,7 +46,7 @@ grpc_completion_queue *grpc_rb_get_wrapped_completion_queue(VALUE v);
* *
* This avoids having code that holds the GIL repeated at multiple sites. * This avoids having code that holds the GIL repeated at multiple sites.
*/ */
grpc_event grpc_rb_completion_queue_pluck_event(VALUE cqueue, VALUE tag, grpc_event grpc_rb_completion_queue_pluck_event(VALUE self, VALUE tag,
VALUE timeout); VALUE timeout);
/* Initializes the CompletionQueue class. */ /* Initializes the CompletionQueue class. */

@ -50,7 +50,6 @@
#include "rb_loader.h" #include "rb_loader.h"
#include "rb_server.h" #include "rb_server.h"
#include "rb_server_credentials.h" #include "rb_server_credentials.h"
#include "rb_signal.h"
static VALUE grpc_rb_cTimeVal = Qnil; static VALUE grpc_rb_cTimeVal = Qnil;
@ -333,7 +332,6 @@ void Init_grpc_c() {
Init_grpc_channel_credentials(); Init_grpc_channel_credentials();
Init_grpc_server(); Init_grpc_server();
Init_grpc_server_credentials(); Init_grpc_server_credentials();
Init_grpc_signals();
Init_grpc_status_codes(); Init_grpc_status_codes();
Init_grpc_time_consts(); Init_grpc_time_consts();
} }

@ -60,6 +60,7 @@ typedef struct grpc_rb_server {
VALUE mark; VALUE mark;
/* The actual server */ /* The actual server */
grpc_server *wrapped; grpc_server *wrapped;
grpc_completion_queue *queue;
} grpc_rb_server; } grpc_rb_server;
/* Destroys server instances. */ /* Destroys server instances. */
@ -145,6 +146,7 @@ static VALUE grpc_rb_server_init(VALUE self, VALUE cqueue, VALUE channel_args) {
} }
grpc_server_register_completion_queue(srv, cq, NULL); grpc_server_register_completion_queue(srv, cq, NULL);
wrapper->wrapped = srv; wrapper->wrapped = srv;
wrapper->queue = cq;
/* Add the cq as the server's mark object. This ensures the ruby cq can't be /* Add the cq as the server's mark object. This ensures the ruby cq can't be
GCed before the server */ GCed before the server */

@ -1,70 +0,0 @@
/*
*
* Copyright 2016, Google Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following disclaimer
* in the documentation and/or other materials provided with the
* distribution.
* * Neither the name of Google Inc. nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
#include <ruby/ruby.h>
#include <signal.h>
#include <stdbool.h>
#include <grpc/support/log.h>
#include "rb_grpc.h"
static void (*old_sigint_handler)(int);
static void (*old_sigterm_handler)(int);
static volatile bool signal_received = false;
/* This has to be handled at the C level instead of Ruby, because Ruby signal
* handlers are constrained to run in the main interpreter thread. If that main
* thread is blocked on grpc_completion_queue_pluck, the signal handlers will
* never run */
static void handle_signal(int signum) {
signal_received = true;
if (signum == SIGINT) {
old_sigint_handler(signum);
} else if (signum == SIGTERM) {
old_sigterm_handler(signum);
}
}
static VALUE grpc_rb_signal_received(VALUE self) {
(void)self;
return signal_received ? Qtrue : Qfalse;
}
void Init_grpc_signals() {
old_sigint_handler = signal(SIGINT, handle_signal);
old_sigterm_handler = signal(SIGTERM, handle_signal);
rb_define_singleton_method(grpc_rb_mGrpcCore, "signal_received?",
grpc_rb_signal_received, 0);
}

@ -1,39 +0,0 @@
/*
*
* Copyright 2016, Google Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following disclaimer
* in the documentation and/or other materials provided with the
* distribution.
* * Neither the name of Google Inc. nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
#ifndef GRPC_RB_SIGNAL_H_
#define GRPC_RB_SIGNAL_H_
void Init_grpc_signals();
#endif /* GRPC_RB_SIGNAL_H_ */

@ -33,7 +33,6 @@ require_relative 'grpc/errors'
require_relative 'grpc/grpc' require_relative 'grpc/grpc'
require_relative 'grpc/logconfig' require_relative 'grpc/logconfig'
require_relative 'grpc/notifier' require_relative 'grpc/notifier'
require_relative 'grpc/signals'
require_relative 'grpc/version' require_relative 'grpc/version'
require_relative 'grpc/core/time_consts' require_relative 'grpc/core/time_consts'
require_relative 'grpc/generic/active_call' require_relative 'grpc/generic/active_call'
@ -48,5 +47,3 @@ begin
ensure ensure
file.close file.close
end end
GRPC::Signals.wait_for_signals

@ -30,7 +30,6 @@
require 'forwardable' require 'forwardable'
require 'weakref' require 'weakref'
require_relative 'bidi_call' require_relative 'bidi_call'
require_relative '../signals'
class Struct class Struct
# BatchResult is the struct returned by calls to call#start_batch. # BatchResult is the struct returned by calls to call#start_batch.
@ -123,10 +122,6 @@ module GRPC
@unmarshal = unmarshal @unmarshal = unmarshal
@metadata_tag = metadata_tag @metadata_tag = metadata_tag
@op_notifier = nil @op_notifier = nil
weak_self = WeakRef.new(self)
remove_handler = GRPC::Signals.register_handler(&weak_self
.method(:cancel))
ObjectSpace.define_finalizer(self, remove_handler)
end end
# output_metadata are provides access to hash that can be used to # output_metadata are provides access to hash that can be used to

@ -28,7 +28,6 @@
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
require_relative '../grpc' require_relative '../grpc'
require_relative '../signals'
require_relative 'active_call' require_relative 'active_call'
require_relative 'service' require_relative 'service'
require 'thread' require 'thread'
@ -353,10 +352,7 @@ module GRPC
transition_running_state(:running) transition_running_state(:running)
@run_cond.broadcast @run_cond.broadcast
end end
remove_signal_handler = GRPC::Signals.register_handler { stop }
loop_handle_server_calls loop_handle_server_calls
# Remove signal handler when server stops
remove_signal_handler.call
end end
alias_method :run_till_terminated, :run alias_method :run_till_terminated, :run

@ -12,7 +12,7 @@
<email>grpc-packages@google.com</email> <email>grpc-packages@google.com</email>
<active>yes</active> <active>yes</active>
</lead> </lead>
<date>2016-04-19</date> <date>2016-05-19</date>
<time>16:06:07</time> <time>16:06:07</time>
<version> <version>
<release>${settings.php_version.php()}</release> <release>${settings.php_version.php()}</release>
@ -24,7 +24,7 @@
</stability> </stability>
<license>BSD</license> <license>BSD</license>
<notes> <notes>
- destroy grpc_byte_buffer after startBatch #6096 - TBD
</notes> </notes>
<contents> <contents>
<dir baseinstalldir="/" name="/"> <dir baseinstalldir="/" name="/">
@ -172,8 +172,8 @@
</release> </release>
<release> <release>
<version> <version>
<release>${settings.php_version.php()}</release> <release>0.14.0</release>
<api>${settings.php_version.php()}</api> <api>0.14.0</api>
</version> </version>
<stability> <stability>
<release>beta</release> <release>beta</release>
@ -185,5 +185,35 @@
- destroy grpc_byte_buffer after startBatch #6096 - destroy grpc_byte_buffer after startBatch #6096
</notes> </notes>
</release> </release>
<release>
<version>
<release>0.14.2</release>
<api>0.14.2</api>
</version>
<stability>
<release>beta</release>
<api>beta</api>
</stability>
<date>2016-05-18</date>
<license>BSD</license>
<notes>
- Updated functions with TSRM macros for ZTS support #6607
</notes>
</release>
<release>
<version>
<release>${settings.php_version.php()}</release>
<api>${settings.php_version.php()}</api>
</version>
<stability>
<release>beta</release>
<api>beta</api>
</stability>
<date>2016-05-19</date>
<license>BSD</license>
<notes>
- TBD
</notes>
</release>
</changelog> </changelog>
</package> </package>

@ -33,7 +33,7 @@
@rem Current package versions @rem Current package versions
set VERSION=${settings.csharp_version} set VERSION=${settings.csharp_version}
set PROTOBUF_VERSION=3.0.0-beta2 set PROTOBUF_VERSION=3.0.0-beta3
@rem Packages that depend on prerelease packages (like Google.Protobuf) need to have prerelease suffix as well. @rem Packages that depend on prerelease packages (like Google.Protobuf) need to have prerelease suffix as well.
set VERSION_WITH_BETA=%VERSION%-beta set VERSION_WITH_BETA=%VERSION%-beta

@ -42,13 +42,15 @@
#include "test/cpp/util/metrics_server.h" #include "test/cpp/util/metrics_server.h"
#include "test/cpp/util/test_config.h" #include "test/cpp/util/test_config.h"
DEFINE_string(metrics_server_address, "", int kDeadlineSecs = 10;
DEFINE_string(metrics_server_address, "localhost:8081",
"The metrics server addresses in the fomrat <hostname>:<port>"); "The metrics server addresses in the fomrat <hostname>:<port>");
DEFINE_int32(deadline_secs, kDeadlineSecs,
"The deadline (in seconds) for RCP call");
DEFINE_bool(total_only, false, DEFINE_bool(total_only, false,
"If true, this prints only the total value of all gauges"); "If true, this prints only the total value of all gauges");
int kDeadlineSecs = 10;
using grpc::testing::EmptyMessage; using grpc::testing::EmptyMessage;
using grpc::testing::GaugeResponse; using grpc::testing::GaugeResponse;
using grpc::testing::MetricsService; using grpc::testing::MetricsService;
@ -56,12 +58,13 @@ using grpc::testing::MetricsServiceImpl;
// Prints the values of all Gauges (unless total_only is set to 'true' in which // Prints the values of all Gauges (unless total_only is set to 'true' in which
// case this only prints the sum of all gauge values). // case this only prints the sum of all gauge values).
bool PrintMetrics(std::unique_ptr<MetricsService::Stub> stub, bool total_only) { bool PrintMetrics(std::unique_ptr<MetricsService::Stub> stub, bool total_only,
int deadline_secs) {
grpc::ClientContext context; grpc::ClientContext context;
EmptyMessage message; EmptyMessage message;
std::chrono::system_clock::time_point deadline = std::chrono::system_clock::time_point deadline =
std::chrono::system_clock::now() + std::chrono::seconds(kDeadlineSecs); std::chrono::system_clock::now() + std::chrono::seconds(deadline_secs);
context.set_deadline(deadline); context.set_deadline(deadline);
@ -108,7 +111,8 @@ int main(int argc, char** argv) {
std::shared_ptr<grpc::Channel> channel(grpc::CreateChannel( std::shared_ptr<grpc::Channel> channel(grpc::CreateChannel(
FLAGS_metrics_server_address, grpc::InsecureChannelCredentials())); FLAGS_metrics_server_address, grpc::InsecureChannelCredentials()));
if (!PrintMetrics(MetricsService::NewStub(channel), FLAGS_total_only)) { if (!PrintMetrics(MetricsService::NewStub(channel), FLAGS_total_only,
FLAGS_deadline_secs)) {
return 1; return 1;
} }

@ -1 +1 @@
Subproject commit a1938b2aa9ca86ce7ce50c27ff9737c1008d2a03 Subproject commit 3470b6895aa659b7559ed678e029a5338e535f14

@ -133,12 +133,15 @@ def run_client():
details = 'Logfile: %s' % logfile_name details = 'Logfile: %s' % logfile_name
logfile = open(logfile_name, 'w') logfile = open(logfile_name, 'w')
metrics_cmd = metrics_client_cmd + [x
for x in metrics_client_args_str.split()]
stress_cmd = stress_client_cmd + [x for x in args_str.split()]
details = '%s, Metrics command: %s, Stress client command: %s' % (
details, str(metrics_cmd), str(stress_cmd))
# Update status that the test is starting (in the status table) # Update status that the test is starting (in the status table)
bq_helper.insert_summary_row(EventType.STARTING, details) bq_helper.insert_summary_row(EventType.STARTING, details)
metrics_cmd = metrics_client_cmd + [x for x in metrics_client_args_str.split()]
stress_cmd = stress_client_cmd + [x for x in args_str.split()]
print 'Launching process %s ...' % stress_cmd print 'Launching process %s ...' % stress_cmd
stress_p = subprocess.Popen(args=stress_cmd, stress_p = subprocess.Popen(args=stress_cmd,
stdout=logfile, stdout=logfile,
@ -147,6 +150,7 @@ def run_client():
qps_history = [1, 1, 1] # Maintain the last 3 qps readings qps_history = [1, 1, 1] # Maintain the last 3 qps readings
qps_history_idx = 0 # Index into the qps_history list qps_history_idx = 0 # Index into the qps_history list
is_running_status_written = False
is_error = False is_error = False
while True: while True:
# Check if stress_client is still running. If so, collect metrics and upload # Check if stress_client is still running. If so, collect metrics and upload
@ -165,6 +169,10 @@ def run_client():
print details print details
break break
if not is_running_status_written:
bq_helper.insert_summary_row(EventType.RUNNING, '')
is_running_status_written = True
# Stress client still running. Get metrics # Stress client still running. Get metrics
qps = _get_qps(metrics_cmd) qps = _get_qps(metrics_cmd)
qps_recorded_at = datetime.datetime.now().isoformat() qps_recorded_at = datetime.datetime.now().isoformat()

@ -106,16 +106,22 @@ def run_server():
logfile = open(logfile_name, 'w') logfile = open(logfile_name, 'w')
details = 'Logfile: %s' % logfile_name details = 'Logfile: %s' % logfile_name
stress_cmd = stress_server_cmd + [x for x in args_str.split()]
details = '%s, Stress server command: %s' % (details, str(stress_cmd))
# Update status that the test is starting (in the status table) # Update status that the test is starting (in the status table)
bq_helper.insert_summary_row(EventType.STARTING, details) bq_helper.insert_summary_row(EventType.STARTING, details)
stress_cmd = stress_server_cmd + [x for x in args_str.split()]
print 'Launching process %s ...' % stress_cmd print 'Launching process %s ...' % stress_cmd
stress_p = subprocess.Popen(args=stress_cmd, stress_p = subprocess.Popen(args=stress_cmd,
stdout=logfile, stdout=logfile,
stderr=subprocess.STDOUT) stderr=subprocess.STDOUT)
# Update the status to running if subprocess.Popen launched the server
if stress_p.poll() is None:
bq_helper.insert_summary_row(EventType.RUNNING, '')
# Wait for the server process to terminate
returncode = stress_p.wait() returncode = stress_p.wait()
if will_run_forever == '1' or returncode != 0: if will_run_forever == '1' or returncode != 0:

@ -46,6 +46,7 @@ import big_query_utils as bq_utils
class EventType: class EventType:
STARTING = 'STARTING' STARTING = 'STARTING'
RUNNING = 'RUNNING'
SUCCESS = 'SUCCESS' SUCCESS = 'SUCCESS'
FAILURE = 'FAILURE' FAILURE = 'FAILURE'
@ -195,11 +196,11 @@ class BigQueryHelper:
('image_type', 'STRING', 'Client or Server?'), ('image_type', 'STRING', 'Client or Server?'),
('pod_name', 'STRING', 'GKE pod hosting this image'), ('pod_name', 'STRING', 'GKE pod hosting this image'),
('event_date', 'STRING', 'The date of this event'), ('event_date', 'STRING', 'The date of this event'),
('event_type', 'STRING', 'STARTED/SUCCESS/FAILURE'), ('event_type', 'STRING', 'STARTING/RUNNING/SUCCESS/FAILURE'),
('details', 'STRING', 'Any other relevant details') ('details', 'STRING', 'Any other relevant details')
] ]
desc = ('The table that contains START/SUCCESS/FAILURE events for ' desc = ('The table that contains STARTING/RUNNING/SUCCESS/FAILURE events '
' the stress test clients and servers') 'for the stress test clients and servers')
return bq_utils.create_table(self.bq, self.project_id, self.dataset_id, return bq_utils.create_table(self.bq, self.project_id, self.dataset_id,
self.summary_table_id, summary_table_schema, self.summary_table_id, summary_table_schema,
desc) desc)

@ -45,7 +45,7 @@ cat << EOF | awk '{ print $1 }' | sort > $want_submodules
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)
f8ac463766281625ad710900479130c7fcb4d63b third_party/nanopb (nanopb-0.3.4-29-gf8ac463) f8ac463766281625ad710900479130c7fcb4d63b third_party/nanopb (nanopb-0.3.4-29-gf8ac463)
a1938b2aa9ca86ce7ce50c27ff9737c1008d2a03 third_party/protobuf (v3.0.0-beta-3-pre1) 3470b6895aa659b7559ed678e029a5338e535f14 third_party/protobuf (v3.0.0-beta-2-441-g3470b68)
50893291621658f355bc5b4d450a8d06a563053d third_party/zlib (v1.2.8) 50893291621658f355bc5b4d450a8d06a563053d third_party/zlib (v1.2.8)
EOF EOF

@ -10,7 +10,7 @@
"baseTemplates": { "baseTemplates": {
"default": { "default": {
"wrapperScriptPath": "/var/local/git/grpc/tools/gcp/stress_test/run_client.py", "wrapperScriptPath": "/var/local/git/grpc/tools/gcp/stress_test/run_client.py",
"pollIntervalSecs": 60, "pollIntervalSecs": 100,
"clientArgs": { "clientArgs": {
"num_channels_per_server":5, "num_channels_per_server":5,
"num_stubs_per_channel":10, "num_stubs_per_channel":10,
@ -20,7 +20,8 @@
"metricsPort": 8081, "metricsPort": 8081,
"metricsArgs": { "metricsArgs": {
"metrics_server_address": "localhost:8081", "metrics_server_address": "localhost:8081",
"total_only": "true" "total_only": "true",
"deadline_secs": 60
} }
} }
}, },
@ -78,7 +79,7 @@
"globalSettings": { "globalSettings": {
"buildDockerImages": true, "buildDockerImages": true,
"pollIntervalSecs": 60, "pollIntervalSecs": 100,
"testDurationSecs": 7200, "testDurationSecs": 7200,
"kubernetesProxyPort": 8009, "kubernetesProxyPort": 8009,
"datasetIdNamePrefix": "stress_test_csharp", "datasetIdNamePrefix": "stress_test_csharp",

@ -10,7 +10,7 @@
"baseTemplates": { "baseTemplates": {
"default": { "default": {
"wrapperScriptPath": "/var/local/git/grpc/tools/gcp/stress_test/run_client.py", "wrapperScriptPath": "/var/local/git/grpc/tools/gcp/stress_test/run_client.py",
"pollIntervalSecs": 60, "pollIntervalSecs": 100,
"clientArgs": { "clientArgs": {
"num_channels_per_server":5, "num_channels_per_server":5,
"num_stubs_per_channel":10, "num_stubs_per_channel":10,
@ -20,7 +20,8 @@
"metricsPort": 8081, "metricsPort": 8081,
"metricsArgs": { "metricsArgs": {
"metrics_server_address": "localhost:8081", "metrics_server_address": "localhost:8081",
"total_only": "true" "total_only": "true",
"deadline_secs": 60
}, },
"env": { "env": {
"STRESSTEST_CLIENT_OPTS":"-Xmx3g -Xms3g -XX:NewSize=1500m -XX:MaxNewSize=1500m -XX:+UseConcMarkSweepGC" "STRESSTEST_CLIENT_OPTS":"-Xmx3g -Xms3g -XX:NewSize=1500m -XX:MaxNewSize=1500m -XX:+UseConcMarkSweepGC"
@ -85,7 +86,7 @@
"globalSettings": { "globalSettings": {
"buildDockerImages": true, "buildDockerImages": true,
"pollIntervalSecs": 60, "pollIntervalSecs": 100,
"testDurationSecs": 7200, "testDurationSecs": 7200,
"kubernetesProxyPort": 8008, "kubernetesProxyPort": 8008,
"datasetIdNamePrefix": "stress_test_java", "datasetIdNamePrefix": "stress_test_java",

@ -1,3 +1,4 @@
#!/usr/bin/env python2.7
# Copyright 2016, Google Inc. # Copyright 2016, Google Inc.
# All rights reserved. # All rights reserved.
# #
@ -26,44 +27,33 @@
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (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.
import argparse
import os
import sys
require 'thread' stress_test_utils_dir = os.path.abspath(os.path.join(
require_relative 'grpc' os.path.dirname(__file__), '../../gcp/stress_test'))
sys.path.append(stress_test_utils_dir)
from stress_test_utils import BigQueryHelper
# GRPC contains the General RPC module. argp = argparse.ArgumentParser(
module GRPC description='Print summary tables',
# Signals contains gRPC functions related to signal handling formatter_class=argparse.ArgumentDefaultsHelpFormatter)
module Signals argp.add_argument('--gcp_project_id',
@interpreter_exiting = false required=True,
@signal_handlers = [] help='The Google Cloud Platform Project Id')
@handlers_mutex = Mutex.new argp.add_argument('--dataset_id', type=str, required=True)
argp.add_argument('--run_id', type=str, required=True)
argp.add_argument('--summary_table_id', type=str, default='summary')
argp.add_argument('--qps_table_id', type=str, default='qps')
argp.add_argument('--summary_only', action='store_true', default=True)
def register_handler(&handler) if __name__ == '__main__':
@handlers_mutex.synchronize do args = argp.parse_args()
@signal_handlers.push(handler) bq_helper = BigQueryHelper(args.run_id, '', '', args.gcp_project_id,
handler.call if @exit_signal_received args.dataset_id, args.summary_table_id,
end args.qps_table_id)
# Returns a function to remove the handler bq_helper.initialize()
lambda do if not args.summary_only:
@handlers_mutex.synchronize { @signal_handlers.delete(handler) } bq_helper.print_qps_records()
end bq_helper.print_summary_records()
end
module_function :register_handler
def wait_for_signals
t = Thread.new do
sleep 0.1 until GRPC::Core.signal_received? || @interpreter_exiting
unless @interpreter_exiting
@handlers_mutex.synchronize do
@signal_handlers.each(&:call)
end
end
end
at_exit do
@interpreter_exiting = true
t.join
end
end
module_function :wait_for_signals
end
end
Loading…
Cancel
Save