|
|
|
@ -61,11 +61,14 @@ namespace Grpc.Microbenchmarks |
|
|
|
|
var native = NativeMethods.Get(); |
|
|
|
|
|
|
|
|
|
// nop the native-call via reflection |
|
|
|
|
NativeMethods.Delegates.grpcsharp_call_send_status_from_server_delegate nop = (CallSafeHandle call, BatchContextSafeHandle ctx, StatusCode statusCode, byte[] statusMessage, UIntPtr statusMessageLen, MetadataArraySafeHandle metadataArray, int sendEmptyInitialMetadata, byte[] optionalSendBuffer, UIntPtr optionalSendBufferLen, WriteFlags writeFlags) => { |
|
|
|
|
completionRegistry.Extract(ctx.Handle).OnComplete(true); // drain the dictionary as we go |
|
|
|
|
return CallError.OK; |
|
|
|
|
}; |
|
|
|
|
native.GetType().GetField(nameof(native.grpcsharp_call_send_status_from_server)).SetValue(native, nop); |
|
|
|
|
unsafe |
|
|
|
|
{ |
|
|
|
|
NativeMethods.Delegates.grpcsharp_call_send_status_from_server_delegate nop = (CallSafeHandle call, BatchContextSafeHandle ctx, StatusCode statusCode, byte* statusMessage, UIntPtr statusMessageLen, MetadataArraySafeHandle metadataArray, int sendEmptyInitialMetadata, byte[] optionalSendBuffer, UIntPtr optionalSendBufferLen, WriteFlags writeFlags) => { |
|
|
|
|
completionRegistry.Extract(ctx.Handle).OnComplete(true); // drain the dictionary as we go |
|
|
|
|
return CallError.OK; |
|
|
|
|
}; |
|
|
|
|
native.GetType().GetField(nameof(native.grpcsharp_call_send_status_from_server)).SetValue(native, nop); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
environment = GrpcEnvironment.AddRef(); |
|
|
|
|
metadata = MetadataArraySafeHandle.Create(Metadata.Empty); |
|
|
|
|