From 37afb9ab2b2e5a8f6a3bae2546e26eda22256976 Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Wed, 18 Feb 2015 11:20:04 -0800 Subject: [PATCH] fixing unknown method call handler on server --- src/csharp/GrpcCore/ServerCallHandler.cs | 18 +++++++++++++++++- src/csharp/GrpcCoreTests/ClientServerTest.cs | 2 -- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/src/csharp/GrpcCore/ServerCallHandler.cs b/src/csharp/GrpcCore/ServerCallHandler.cs index 73dfa52def8..48d1eaa3359 100644 --- a/src/csharp/GrpcCore/ServerCallHandler.cs +++ b/src/csharp/GrpcCore/ServerCallHandler.cs @@ -109,12 +109,28 @@ namespace Google.GRPC.Core asyncCall.InitializeServer(call); - var finishedTask = asyncCall.ServerSideUnaryRequestCallAsync(); + var finishedTask = asyncCall.ServerSideStreamingRequestCallAsync(new NullObserver()); asyncCall.SendStatusFromServerAsync(new Status(StatusCode.GRPC_STATUS_UNIMPLEMENTED, "No such method.")).Wait(); finishedTask.Wait(); } } + + internal class NullObserver : IObserver + { + public void OnCompleted() + { + } + + public void OnError(Exception error) + { + } + + public void OnNext(T value) + { + } + + } } diff --git a/src/csharp/GrpcCoreTests/ClientServerTest.cs b/src/csharp/GrpcCoreTests/ClientServerTest.cs index 37d770e0c04..d0e357e29a6 100644 --- a/src/csharp/GrpcCoreTests/ClientServerTest.cs +++ b/src/csharp/GrpcCoreTests/ClientServerTest.cs @@ -85,8 +85,6 @@ namespace Google.GRPC.Core.Tests } server.ShutdownAsync().Wait(); - - GrpcEnvironment.Shutdown(); } [Test]