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); }
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(); } } }
public void RegisterRequestCallCompletion(RequestCallContextSafeHandle ctx, RequestCallCompletionDelegate callback) { ctx.CompletionCallback = callback; Register(ctx.Handle, ctx); }
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);