reorder clientside send preconditions

pull/6699/head
Jan Tattermusch 9 years ago
parent d910833175
commit 6854c70c94
  1. 6
      src/csharp/Grpc.Core/Internal/AsyncCall.cs

@ -366,6 +366,9 @@ namespace Grpc.Core.Internal
private Task CheckSendPreconditionsClientSide()
{
GrpcPreconditions.CheckState(!halfcloseRequested, "Request stream has already been completed.");
GrpcPreconditions.CheckState(streamingWriteTcs == null, "Only one write can be pending at a time.");
if (cancelRequested)
{
// Return a cancelled task.
@ -374,9 +377,6 @@ namespace Grpc.Core.Internal
return tcs.Task;
}
GrpcPreconditions.CheckState(!halfcloseRequested, "Request stream has already been completed.");
GrpcPreconditions.CheckState(streamingWriteTcs == null, "Only one write can be pending at a time.");
return null;
}

Loading…
Cancel
Save