aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/csharp/Grpc.Core
diff options
context:
space:
mode:
authorGravatar Jan Tattermusch <jtattermusch@google.com>2016-06-13 17:24:15 -0700
committerGravatar Jan Tattermusch <jtattermusch@google.com>2016-06-14 17:50:41 -0700
commitb8d50af3a58f99a4c0d379d9a68f7bc4dd383f7e (patch)
tree4acd67b5ed019ff5ab90bfa88da42bbd0f298750 /src/csharp/Grpc.Core
parentfebfd32af9a920b840f6b5684247b7e005552f7c (diff)
deduplicate send finished handler
Diffstat (limited to 'src/csharp/Grpc.Core')
-rw-r--r--src/csharp/Grpc.Core/Internal/AsyncCall.cs2
-rw-r--r--src/csharp/Grpc.Core/Internal/AsyncCallBase.cs27
2 files changed, 2 insertions, 27 deletions
diff --git a/src/csharp/Grpc.Core/Internal/AsyncCall.cs b/src/csharp/Grpc.Core/Internal/AsyncCall.cs
index 895be690a5..f549c52876 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 cb8366c216..eb9c3ea62d 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)
{
@@ -272,31 +272,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>
protected void HandleSendStatusFromServerFinished(bool success)