diff --git a/src/csharp/Grpc.Core/Internal/AsyncCall.cs b/src/csharp/Grpc.Core/Internal/AsyncCall.cs index 895be690a590445087ef96707104cb0da7f97042..f549c528762a7885e38065d4c5bdd6a2d2365a29 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<object>(null); } - call.StartSendCloseFromClient(HandleSendCloseFromClientFinished); + call.StartSendCloseFromClient(HandleSendFinished); halfcloseRequested = true; streamingWriteTcs = new TaskCompletionSource<object>(); diff --git a/src/csharp/Grpc.Core/Internal/AsyncCallBase.cs b/src/csharp/Grpc.Core/Internal/AsyncCallBase.cs index cb8366c21666d236d441fcbf545678010e00a5a5..eb9c3ea62d15431dc8a5af220909fcc645710a38 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 } /// <summary> - /// Handles send completion. + /// Handles send completion (including SendCloseFromClient). /// </summary> protected void HandleSendFinished(bool success) { @@ -271,31 +271,6 @@ namespace Grpc.Core.Internal } } - /// <summary> - /// Handles halfclose (send close from client) completion. - /// </summary> - protected void HandleSendCloseFromClientFinished(bool success) - { - TaskCompletionSource<object> 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); - } - } - /// <summary> /// Handles send status from server completion. /// </summary>