diff --git a/src/csharp/Grpc.Core/Internal/AsyncCall.cs b/src/csharp/Grpc.Core/Internal/AsyncCall.cs index 895be690a59..f549c528762 100644 --- a/src/csharp/Grpc.Core/Internal/AsyncCall.cs +++ b/src/csharp/Grpc.Core/Internal/AsyncCall.cs @@ -267,7 +267,7 @@ namespace Grpc.Core.Internal halfcloseRequested = true; return Task.FromResult(null); } - call.StartSendCloseFromClient(HandleSendCloseFromClientFinished); + call.StartSendCloseFromClient(HandleSendFinished); halfcloseRequested = true; streamingWriteTcs = new TaskCompletionSource(); diff --git a/src/csharp/Grpc.Core/Internal/AsyncCallBase.cs b/src/csharp/Grpc.Core/Internal/AsyncCallBase.cs index cb8366c2166..eb9c3ea62d1 100644 --- a/src/csharp/Grpc.Core/Internal/AsyncCallBase.cs +++ b/src/csharp/Grpc.Core/Internal/AsyncCallBase.cs @@ -248,7 +248,7 @@ namespace Grpc.Core.Internal } /// - /// Handles send completion. + /// Handles send completion (including SendCloseFromClient). /// protected void HandleSendFinished(bool success) { @@ -271,31 +271,6 @@ namespace Grpc.Core.Internal } } - /// - /// Handles halfclose (send close from client) completion. - /// - protected void HandleSendCloseFromClientFinished(bool success) - { - TaskCompletionSource origTcs = null; - lock (myLock) - { - origTcs = streamingWriteTcs; - streamingWriteTcs = null; - - ReleaseResourcesIfPossible(); - } - - if (!success) - { - // TODO(jtattermusch): this method is same as HandleSendFinished (only the error message differs). - origTcs.SetException(new InvalidOperationException("Sending close from client has failed.")); - } - else - { - origTcs.SetResult(null); - } - } - /// /// Handles send status from server completion. ///