|
|
|
@ -160,16 +160,15 @@ namespace Grpc.Core.Internal |
|
|
|
|
halfcloseRequested = true; |
|
|
|
|
readingDone = true; |
|
|
|
|
|
|
|
|
|
//var payload = UnsafeSerialize(msg); |
|
|
|
|
|
|
|
|
|
unaryResponseTcs = new TaskCompletionSource<TResponse>(); |
|
|
|
|
using (var serializationScope = DefaultSerializationContext.GetInitializedThreadLocalScope()) |
|
|
|
|
using (var metadataArray = MetadataArraySafeHandle.Create(details.Options.Headers)) |
|
|
|
|
{ |
|
|
|
|
var payload = UnsafeSerialize(msg, serializationScope.Context); // do before metadata array? |
|
|
|
|
|
|
|
|
|
call.StartUnary(UnaryResponseClientCallback, payload, GetWriteFlagsForCall(), metadataArray, details.Options.Flags); |
|
|
|
|
callStartedOk = true; |
|
|
|
|
var payload = UnsafeSerialize(msg, serializationScope.Context); |
|
|
|
|
unaryResponseTcs = new TaskCompletionSource<TResponse>(); |
|
|
|
|
using (var metadataArray = MetadataArraySafeHandle.Create(details.Options.Headers)) |
|
|
|
|
{ |
|
|
|
|
call.StartUnary(UnaryResponseClientCallback, payload, GetWriteFlagsForCall(), metadataArray, details.Options.Flags); |
|
|
|
|
callStartedOk = true; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return unaryResponseTcs.Task; |
|
|
|
@ -238,17 +237,15 @@ namespace Grpc.Core.Internal |
|
|
|
|
|
|
|
|
|
halfcloseRequested = true; |
|
|
|
|
|
|
|
|
|
//var payload = UnsafeSerialize(msg); |
|
|
|
|
|
|
|
|
|
streamingResponseCallFinishedTcs = new TaskCompletionSource<object>(); |
|
|
|
|
|
|
|
|
|
using (var serializationScope = DefaultSerializationContext.GetInitializedThreadLocalScope()) |
|
|
|
|
using (var metadataArray = MetadataArraySafeHandle.Create(details.Options.Headers)) |
|
|
|
|
{ |
|
|
|
|
var payload = UnsafeSerialize(msg, serializationScope.Context); // do before metadata array? |
|
|
|
|
|
|
|
|
|
call.StartServerStreaming(ReceivedStatusOnClientCallback, payload, GetWriteFlagsForCall(), metadataArray, details.Options.Flags); |
|
|
|
|
callStartedOk = true; |
|
|
|
|
var payload = UnsafeSerialize(msg, serializationScope.Context); |
|
|
|
|
streamingResponseCallFinishedTcs = new TaskCompletionSource<object>(); |
|
|
|
|
using (var metadataArray = MetadataArraySafeHandle.Create(details.Options.Headers)) |
|
|
|
|
{ |
|
|
|
|
call.StartServerStreaming(ReceivedStatusOnClientCallback, payload, GetWriteFlagsForCall(), metadataArray, details.Options.Flags); |
|
|
|
|
callStartedOk = true; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
call.StartReceiveInitialMetadata(ReceivedResponseHeadersCallback); |
|
|
|
|
} |
|
|
|
|