public void StartUnary(BatchContextSafeHandle ctx, byte[] payload, MetadataArraySafeHandle metadataArray, WriteFlags writeFlags) { using (Profilers.ForCurrentThread().NewScope("CallSafeHandle.StartUnary")) { Native.grpcsharp_call_start_unary(this, ctx, payload, new UIntPtr((ulong)payload.Length), metadataArray, writeFlags) .CheckOk(); } }
private static void HandleBatchCompletion(bool success, BatchContextSafeHandle ctx, BatchCompletionDelegate callback) { try { callback(success, ctx); } catch (Exception e) { Logger.Error(e, "Exception occured while invoking completion delegate."); } finally { if (ctx != null) { ctx.Dispose(); } } }
private static void HandleBatchCompletion(bool success, BatchContextSafeHandle ctx, BatchCompletionDelegate callback) { try { callback(success, ctx); } catch (Exception e) { Console.WriteLine("Exception occured while invoking completion delegate: " + e); } finally { if (ctx != null) { ctx.Dispose(); } } }
static extern CallSafeHandle grpcsharp_batch_context_server_rpc_new_call(BatchContextSafeHandle ctx);
static extern IntPtr grpcsharp_batch_context_server_rpc_new_host(BatchContextSafeHandle ctx); // returns const char*
GRPCCallError IPlatformInvocation.grpcsharp_server_request_call(ServerSafeHandle server, CompletionQueueSafeHandle cq, BatchContextSafeHandle ctx) { return grpcsharp_server_request_call(server, cq, ctx); }
IntPtr IPlatformInvocation.grpcsharp_batch_context_recv_initial_metadata(BatchContextSafeHandle ctx) { return grpcsharp_batch_context_recv_initial_metadata(ctx); }
static extern StatusCode grpcsharp_batch_context_recv_status_on_client_status(BatchContextSafeHandle ctx);
IntPtr IPlatformInvocation.grpcsharp_batch_context_recv_initial_metadata(BatchContextSafeHandle ctx) { return(grpcsharp_batch_context_recv_initial_metadata(ctx)); }
static extern IntPtr grpcsharp_batch_context_recv_initial_metadata(BatchContextSafeHandle ctx);
static extern IntPtr grpcsharp_batch_context_server_rpc_new_request_metadata(BatchContextSafeHandle ctx);
static extern int grpcsharp_batch_context_recv_close_on_server_cancelled(BatchContextSafeHandle ctx);
void IPlatformInvocation.grpcsharp_server_shutdown_and_notify_callback(ServerSafeHandle server, CompletionQueueSafeHandle cq, BatchContextSafeHandle ctx) { grpcsharp_server_shutdown_and_notify_callback(server, cq, ctx); }
static extern Timespec grpcsharp_batch_context_server_rpc_new_deadline(BatchContextSafeHandle ctx);
GRPCCallError IPlatformInvocation.grpcsharp_server_request_call(ServerSafeHandle server, CompletionQueueSafeHandle cq, BatchContextSafeHandle ctx) { return(grpcsharp_server_request_call(server, cq, ctx)); }
GRPCCallError IPlatformInvocation.grpcsharp_call_recv_message(CallSafeHandle call, BatchContextSafeHandle ctx) { return grpcsharp_call_recv_message(call, ctx); }
IntPtr IPlatformInvocation.grpcsharp_batch_context_recv_message_length(BatchContextSafeHandle ctx) { return(grpcsharp_batch_context_recv_message_length(ctx)); }
GRPCCallError IPlatformInvocation.grpcsharp_call_start_serverside(CallSafeHandle call, BatchContextSafeHandle ctx) { return grpcsharp_call_start_serverside(call, ctx); }
void IPlatformInvocation.grpcsharp_batch_context_recv_message_to_buffer(BatchContextSafeHandle ctx, byte[] buffer, UIntPtr bufferLen) { grpcsharp_batch_context_recv_message_to_buffer(ctx, buffer, bufferLen); }
void IPlatformInvocation.grpcsharp_channel_watch_connectivity_state(ChannelSafeHandle channel, ChannelState lastObservedState, Timespec deadline, CompletionQueueSafeHandle cq, BatchContextSafeHandle ctx) { grpcsharp_channel_watch_connectivity_state(channel, lastObservedState, deadline, cq, ctx); }
public void RegisterBatchCompletion(BatchContextSafeHandle ctx, BatchCompletionDelegate callback) { OpCompletionDelegate opCallback = ((success) => HandleBatchCompletion(success, ctx, callback)); Register(ctx.Handle, opCallback); }
static extern IntPtr grpcsharp_batch_context_recv_status_on_client_trailing_metadata(BatchContextSafeHandle ctx);
StatusCode IPlatformInvocation.grpcsharp_batch_context_recv_status_on_client_status(BatchContextSafeHandle ctx) { return(grpcsharp_batch_context_recv_status_on_client_status(ctx)); }
static extern void grpcsharp_server_shutdown_and_notify_callback(ServerSafeHandle server, CompletionQueueSafeHandle cq, BatchContextSafeHandle ctx);
IntPtr IPlatformInvocation.grpcsharp_batch_context_recv_status_on_client_details(BatchContextSafeHandle ctx) // returns const char* { return(grpcsharp_batch_context_recv_status_on_client_details(ctx)); }
static extern GRPCCallError grpcsharp_server_request_call(ServerSafeHandle server, CompletionQueueSafeHandle cq, BatchContextSafeHandle ctx);
GRPCCallError IPlatformInvocation.grpcsharp_call_send_close_from_client(CallSafeHandle call, BatchContextSafeHandle ctx) { return grpcsharp_call_send_close_from_client(call, ctx); }
IntPtr IPlatformInvocation.grpcsharp_batch_context_recv_status_on_client_trailing_metadata(BatchContextSafeHandle ctx) { return(grpcsharp_batch_context_recv_status_on_client_trailing_metadata(ctx)); }
GRPCCallError IPlatformInvocation.grpcsharp_call_send_message(CallSafeHandle call, BatchContextSafeHandle ctx, byte[] send_buffer, UIntPtr send_buffer_len, WriteFlags writeFlags, bool sendEmptyInitialMetadata) { return grpcsharp_call_send_message(call, ctx, send_buffer, send_buffer_len, writeFlags, sendEmptyInitialMetadata); }
CallSafeHandle IPlatformInvocation.grpcsharp_batch_context_server_rpc_new_call(BatchContextSafeHandle ctx) { return(grpcsharp_batch_context_server_rpc_new_call(ctx)); }
GRPCCallError IPlatformInvocation.grpcsharp_call_send_status_from_server(CallSafeHandle call, BatchContextSafeHandle ctx, StatusCode statusCode, string statusMessage, MetadataArraySafeHandle metadataArray, bool sendEmptyInitialMetadata) { return grpcsharp_call_send_status_from_server(call, ctx, statusCode, statusMessage, metadataArray, sendEmptyInitialMetadata); }
IntPtr IPlatformInvocation.grpcsharp_batch_context_server_rpc_new_host(BatchContextSafeHandle ctx) // returns const char* { return(grpcsharp_batch_context_server_rpc_new_host(ctx)); }
GRPCCallError IPlatformInvocation.grpcsharp_call_recv_initial_metadata(CallSafeHandle call, BatchContextSafeHandle ctx) { return grpcsharp_call_recv_initial_metadata(call, ctx); }
Timespec IPlatformInvocation.grpcsharp_batch_context_server_rpc_new_deadline(BatchContextSafeHandle ctx) { return(grpcsharp_batch_context_server_rpc_new_deadline(ctx)); }
GRPCCallError IPlatformInvocation.grpcsharp_call_send_initial_metadata(CallSafeHandle call, BatchContextSafeHandle ctx, MetadataArraySafeHandle metadataArray) { return grpcsharp_call_send_initial_metadata(call, ctx, metadataArray); }
IntPtr IPlatformInvocation.grpcsharp_batch_context_server_rpc_new_request_metadata(BatchContextSafeHandle ctx) { return(grpcsharp_batch_context_server_rpc_new_request_metadata(ctx)); }
static extern IntPtr grpcsharp_batch_context_recv_message_length(BatchContextSafeHandle ctx);
int IPlatformInvocation.grpcsharp_batch_context_recv_close_on_server_cancelled(BatchContextSafeHandle ctx) { return(grpcsharp_batch_context_recv_close_on_server_cancelled(ctx)); }
static extern void grpcsharp_batch_context_recv_message_to_buffer(BatchContextSafeHandle ctx, byte[] buffer, UIntPtr bufferLen);
static extern GRPCCallError grpcsharp_call_start_server_streaming(CallSafeHandle call, BatchContextSafeHandle ctx, byte[] send_buffer, UIntPtr send_buffer_len, MetadataArraySafeHandle metadataArray, WriteFlags writeFlags);
static extern IntPtr grpcsharp_batch_context_recv_status_on_client_details(BatchContextSafeHandle ctx); // returns const char*
static extern GRPCCallError grpcsharp_call_start_duplex_streaming(CallSafeHandle call, BatchContextSafeHandle ctx, MetadataArraySafeHandle metadataArray);
static extern GRPCCallError grpcsharp_call_send_message(CallSafeHandle call, BatchContextSafeHandle ctx, byte[] send_buffer, UIntPtr send_buffer_len, WriteFlags writeFlags, bool sendEmptyInitialMetadata);
static extern GRPCCallError grpcsharp_call_send_close_from_client(CallSafeHandle call, BatchContextSafeHandle ctx);
static extern GRPCCallError grpcsharp_call_send_status_from_server(CallSafeHandle call, BatchContextSafeHandle ctx, StatusCode statusCode, string statusMessage, MetadataArraySafeHandle metadataArray, bool sendEmptyInitialMetadata);
static extern GRPCCallError grpcsharp_call_recv_message(CallSafeHandle call, BatchContextSafeHandle ctx);
static extern GRPCCallError grpcsharp_call_recv_initial_metadata(CallSafeHandle call, BatchContextSafeHandle ctx);
IntPtr IPlatformInvocation.grpcsharp_batch_context_recv_message_length(BatchContextSafeHandle ctx) { return grpcsharp_batch_context_recv_message_length(ctx); }
static extern GRPCCallError grpcsharp_call_start_serverside(CallSafeHandle call, BatchContextSafeHandle ctx);
static extern void grpcsharp_channel_watch_connectivity_state(ChannelSafeHandle channel, ChannelState lastObservedState, Timespec deadline, CompletionQueueSafeHandle cq, BatchContextSafeHandle ctx);
static extern GRPCCallError grpcsharp_call_send_initial_metadata(CallSafeHandle call, BatchContextSafeHandle ctx, MetadataArraySafeHandle metadataArray);