Example #1
0
        public void RegisterRequestCallCompletion(RequestCallContextSafeHandle ctx, RequestCallCompletionDelegate callback)
        {
            // TODO(jtattermusch): get rid of new delegate creation here
            OpCompletionDelegate opCallback = ((success) => HandleRequestCallCompletion(success, ctx, callback));

            Register(ctx.Handle, opCallback);
        }
Example #2
0
 private static void HandleRequestCallCompletion(bool success, RequestCallContextSafeHandle ctx, RequestCallCompletionDelegate callback)
 {
     try
     {
         callback(success, ctx);
     }
     catch (Exception e)
     {
         Logger.Error(e, "Exception occured while invoking request call completion delegate.");
     }
     finally
     {
         if (ctx != null)
         {
             ctx.Dispose();
         }
     }
 }
Example #3
0
 public void RegisterRequestCallCompletion(RequestCallContextSafeHandle ctx, RequestCallCompletionDelegate callback)
 {
     ctx.CompletionCallback = callback;
     Register(ctx.Handle, ctx);
 }
Example #4
0
        public void RegisterRequestCallCompletion(RequestCallContextSafeHandle ctx, RequestCallCompletionDelegate callback)
        {
            OpCompletionDelegate opCallback = ((success) => HandleRequestCallCompletion(success, ctx, callback));

            Register(ctx.Handle, opCallback);
        }
 internal static extern IntPtr grpcsharp_request_call_context_request_metadata(RequestCallContextSafeHandle ctx);
 internal static extern IntPtr grpcsharp_request_call_context_host(RequestCallContextSafeHandle ctx, out UIntPtr hostLength);
 internal static extern Timespec grpcsharp_request_call_context_deadline(RequestCallContextSafeHandle ctx);
 internal static extern IntPtr grpcsharp_request_call_context_method(RequestCallContextSafeHandle ctx, out UIntPtr methodLength);
 internal static extern CallSafeHandle grpcsharp_request_call_context_call(RequestCallContextSafeHandle handler);
 internal static extern CallError grpcsharp_server_request_call(ServerSafeHandle server, CompletionQueueSafeHandle cq, RequestCallContextSafeHandle ctx);
Example #11
0
 public void RegisterRequestCallCompletion(RequestCallContextSafeHandle ctx, RequestCallCompletionDelegate callback)
 {
     OpCompletionDelegate opCallback = ((success) => HandleRequestCallCompletion(success, ctx, callback));
     Register(ctx.Handle, opCallback);
 }
Example #12
0
 private static void HandleRequestCallCompletion(bool success, RequestCallContextSafeHandle ctx, RequestCallCompletionDelegate callback)
 {
     try
     {
         callback(success, ctx);
     }
     catch (Exception e)
     {
         Logger.Error(e, "Exception occured while invoking request call completion delegate.");
     }
     finally
     {
         if (ctx != null)
         {
             ctx.Dispose();
         }
     }
 }