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();
         }
     }
 }
Beispiel #3
0
 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();
         }
     }
 }
Beispiel #4
0
 static extern CallSafeHandle grpcsharp_batch_context_server_rpc_new_call(BatchContextSafeHandle ctx);
Beispiel #5
0
 static extern IntPtr grpcsharp_batch_context_server_rpc_new_host(BatchContextSafeHandle ctx);  // returns const char*
Beispiel #6
0
 GRPCCallError IPlatformInvocation.grpcsharp_server_request_call(ServerSafeHandle server,
     CompletionQueueSafeHandle cq, BatchContextSafeHandle ctx)
 {
     return grpcsharp_server_request_call(server, cq, ctx);
 }
Beispiel #7
0
 IntPtr IPlatformInvocation.grpcsharp_batch_context_recv_initial_metadata(BatchContextSafeHandle ctx)
 {
     return grpcsharp_batch_context_recv_initial_metadata(ctx);
 }
Beispiel #8
0
 static extern StatusCode grpcsharp_batch_context_recv_status_on_client_status(BatchContextSafeHandle ctx);
Beispiel #9
0
 static extern IntPtr grpcsharp_batch_context_server_rpc_new_host(BatchContextSafeHandle ctx);  // returns const char*
Beispiel #10
0
 IntPtr IPlatformInvocation.grpcsharp_batch_context_recv_initial_metadata(BatchContextSafeHandle ctx)
 {
     return(grpcsharp_batch_context_recv_initial_metadata(ctx));
 }
Beispiel #11
0
 static extern IntPtr grpcsharp_batch_context_recv_initial_metadata(BatchContextSafeHandle ctx);
Beispiel #12
0
 static extern IntPtr grpcsharp_batch_context_server_rpc_new_request_metadata(BatchContextSafeHandle ctx);
Beispiel #13
0
 static extern int grpcsharp_batch_context_recv_close_on_server_cancelled(BatchContextSafeHandle ctx);
Beispiel #14
0
 void IPlatformInvocation.grpcsharp_server_shutdown_and_notify_callback(ServerSafeHandle server,
                                                                        CompletionQueueSafeHandle cq, BatchContextSafeHandle ctx)
 {
     grpcsharp_server_shutdown_and_notify_callback(server, cq, ctx);
 }
Beispiel #15
0
 static extern Timespec grpcsharp_batch_context_server_rpc_new_deadline(BatchContextSafeHandle ctx);
Beispiel #16
0
 GRPCCallError IPlatformInvocation.grpcsharp_server_request_call(ServerSafeHandle server,
                                                                 CompletionQueueSafeHandle cq, BatchContextSafeHandle ctx)
 {
     return(grpcsharp_server_request_call(server, cq, ctx));
 }
Beispiel #17
0
 GRPCCallError IPlatformInvocation.grpcsharp_call_recv_message(CallSafeHandle call,
     BatchContextSafeHandle ctx)
 {
     return grpcsharp_call_recv_message(call, ctx);
 }
Beispiel #18
0
 IntPtr IPlatformInvocation.grpcsharp_batch_context_recv_message_length(BatchContextSafeHandle ctx)
 {
     return(grpcsharp_batch_context_recv_message_length(ctx));
 }
Beispiel #19
0
 GRPCCallError IPlatformInvocation.grpcsharp_call_start_serverside(CallSafeHandle call,
     BatchContextSafeHandle ctx)
 {
     return grpcsharp_call_start_serverside(call, ctx);
 }
Beispiel #20
0
 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);
 }
Beispiel #21
0
 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);
 }
Beispiel #22
0
        public void RegisterBatchCompletion(BatchContextSafeHandle ctx, BatchCompletionDelegate callback)
        {
            OpCompletionDelegate opCallback = ((success) => HandleBatchCompletion(success, ctx, callback));

            Register(ctx.Handle, opCallback);
        }
Beispiel #23
0
 static extern IntPtr grpcsharp_batch_context_recv_status_on_client_trailing_metadata(BatchContextSafeHandle ctx);
Beispiel #24
0
 StatusCode IPlatformInvocation.grpcsharp_batch_context_recv_status_on_client_status(BatchContextSafeHandle ctx)
 {
     return(grpcsharp_batch_context_recv_status_on_client_status(ctx));
 }
Beispiel #25
0
 static extern void grpcsharp_server_shutdown_and_notify_callback(ServerSafeHandle server, CompletionQueueSafeHandle cq, BatchContextSafeHandle ctx);
Beispiel #26
0
 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));
 }
Beispiel #27
0
 static extern IntPtr grpcsharp_batch_context_server_rpc_new_request_metadata(BatchContextSafeHandle ctx);
Beispiel #28
0
 static extern GRPCCallError grpcsharp_server_request_call(ServerSafeHandle server, CompletionQueueSafeHandle cq, BatchContextSafeHandle ctx);
Beispiel #29
0
 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);
 }
Beispiel #30
0
 GRPCCallError IPlatformInvocation.grpcsharp_call_send_close_from_client(CallSafeHandle call,
     BatchContextSafeHandle ctx)
 {
     return grpcsharp_call_send_close_from_client(call, ctx);
 }
Beispiel #31
0
 IntPtr IPlatformInvocation.grpcsharp_batch_context_recv_status_on_client_trailing_metadata(BatchContextSafeHandle ctx)
 {
     return(grpcsharp_batch_context_recv_status_on_client_trailing_metadata(ctx));
 }
Beispiel #32
0
 static extern void grpcsharp_server_shutdown_and_notify_callback(ServerSafeHandle server, CompletionQueueSafeHandle cq, BatchContextSafeHandle ctx);
Beispiel #33
0
 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);
 }
Beispiel #34
0
 CallSafeHandle IPlatformInvocation.grpcsharp_batch_context_server_rpc_new_call(BatchContextSafeHandle ctx)
 {
     return(grpcsharp_batch_context_server_rpc_new_call(ctx));
 }
Beispiel #35
0
 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);
 }
Beispiel #36
0
 IntPtr IPlatformInvocation.grpcsharp_batch_context_server_rpc_new_host(BatchContextSafeHandle ctx) // returns const char*
 {
     return(grpcsharp_batch_context_server_rpc_new_host(ctx));
 }
Beispiel #37
0
 GRPCCallError IPlatformInvocation.grpcsharp_call_recv_initial_metadata(CallSafeHandle call,
     BatchContextSafeHandle ctx)
 {
     return grpcsharp_call_recv_initial_metadata(call, ctx);
 }
Beispiel #38
0
 Timespec IPlatformInvocation.grpcsharp_batch_context_server_rpc_new_deadline(BatchContextSafeHandle ctx)
 {
     return(grpcsharp_batch_context_server_rpc_new_deadline(ctx));
 }
Beispiel #39
0
 GRPCCallError IPlatformInvocation.grpcsharp_call_send_initial_metadata(CallSafeHandle call,
     BatchContextSafeHandle ctx, MetadataArraySafeHandle metadataArray)
 {
     return grpcsharp_call_send_initial_metadata(call, ctx, metadataArray);
 }
Beispiel #40
0
 IntPtr IPlatformInvocation.grpcsharp_batch_context_server_rpc_new_request_metadata(BatchContextSafeHandle ctx)
 {
     return(grpcsharp_batch_context_server_rpc_new_request_metadata(ctx));
 }
Beispiel #41
0
 static extern IntPtr grpcsharp_batch_context_recv_message_length(BatchContextSafeHandle ctx);
Beispiel #42
0
 int IPlatformInvocation.grpcsharp_batch_context_recv_close_on_server_cancelled(BatchContextSafeHandle ctx)
 {
     return(grpcsharp_batch_context_recv_close_on_server_cancelled(ctx));
 }
Beispiel #43
0
 static extern void grpcsharp_batch_context_recv_message_to_buffer(BatchContextSafeHandle ctx, byte[] buffer, UIntPtr bufferLen);
Beispiel #44
0
 static extern GRPCCallError grpcsharp_call_start_server_streaming(CallSafeHandle call,
                                                                   BatchContextSafeHandle ctx, byte[] send_buffer, UIntPtr send_buffer_len,
                                                                   MetadataArraySafeHandle metadataArray, WriteFlags writeFlags);
Beispiel #45
0
 static extern IntPtr grpcsharp_batch_context_recv_status_on_client_details(BatchContextSafeHandle ctx);  // returns const char*
Beispiel #46
0
 static extern GRPCCallError grpcsharp_call_start_duplex_streaming(CallSafeHandle call,
                                                                   BatchContextSafeHandle ctx, MetadataArraySafeHandle metadataArray);
Beispiel #47
0
 static extern CallSafeHandle grpcsharp_batch_context_server_rpc_new_call(BatchContextSafeHandle ctx);
Beispiel #48
0
 static extern GRPCCallError grpcsharp_call_send_message(CallSafeHandle call,
                                                         BatchContextSafeHandle ctx, byte[] send_buffer, UIntPtr send_buffer_len, WriteFlags writeFlags, bool sendEmptyInitialMetadata);
Beispiel #49
0
 static extern GRPCCallError grpcsharp_server_request_call(ServerSafeHandle server, CompletionQueueSafeHandle cq, BatchContextSafeHandle ctx);
Beispiel #50
0
 static extern GRPCCallError grpcsharp_call_send_close_from_client(CallSafeHandle call,
                                                                   BatchContextSafeHandle ctx);
Beispiel #51
0
 static extern Timespec grpcsharp_batch_context_server_rpc_new_deadline(BatchContextSafeHandle ctx);
Beispiel #52
0
 static extern GRPCCallError grpcsharp_call_send_status_from_server(CallSafeHandle call,
                                                                    BatchContextSafeHandle ctx, StatusCode statusCode, string statusMessage, MetadataArraySafeHandle metadataArray, bool sendEmptyInitialMetadata);
Beispiel #53
0
 void IPlatformInvocation.grpcsharp_server_shutdown_and_notify_callback(ServerSafeHandle server,
     CompletionQueueSafeHandle cq, BatchContextSafeHandle ctx)
 {
     grpcsharp_server_shutdown_and_notify_callback(server, cq, ctx);
 }
Beispiel #54
0
 static extern GRPCCallError grpcsharp_call_recv_message(CallSafeHandle call,
                                                         BatchContextSafeHandle ctx);
Beispiel #55
0
 static extern int grpcsharp_batch_context_recv_close_on_server_cancelled(BatchContextSafeHandle ctx);
Beispiel #56
0
 static extern GRPCCallError grpcsharp_call_recv_initial_metadata(CallSafeHandle call,
                                                                  BatchContextSafeHandle ctx);
Beispiel #57
0
 IntPtr IPlatformInvocation.grpcsharp_batch_context_recv_message_length(BatchContextSafeHandle ctx)
 {
     return grpcsharp_batch_context_recv_message_length(ctx);
 }
Beispiel #58
0
 static extern GRPCCallError grpcsharp_call_start_serverside(CallSafeHandle call,
                                                             BatchContextSafeHandle ctx);
Beispiel #59
0
 static extern void grpcsharp_channel_watch_connectivity_state(ChannelSafeHandle channel, ChannelState lastObservedState,
     Timespec deadline, CompletionQueueSafeHandle cq, BatchContextSafeHandle ctx);
Beispiel #60
0
 static extern GRPCCallError grpcsharp_call_send_initial_metadata(CallSafeHandle call,
                                                                  BatchContextSafeHandle ctx, MetadataArraySafeHandle metadataArray);