make sync unary call behave more like async unary

pull/16554/head
Jan Tattermusch 6 years ago
parent b155c314f1
commit ee510fb328
  1. 4
      src/csharp/Grpc.Core/Internal/AsyncCall.cs

@ -80,8 +80,6 @@ namespace Grpc.Core.Internal
using (profiler.NewScope("AsyncCall.UnaryCall"))
using (CompletionQueueSafeHandle cq = CompletionQueueSafeHandle.CreateSync())
{
byte[] payload = UnsafeSerialize(msg);
bool callStartedOk = false;
try
{
@ -97,6 +95,8 @@ namespace Grpc.Core.Internal
readingDone = true;
}
byte[] payload = UnsafeSerialize(msg);
using (var metadataArray = MetadataArraySafeHandle.Create(details.Options.Headers))
{
var ctx = details.Channel.Environment.BatchContextPool.Lease();

Loading…
Cancel
Save