|
|
@ -53,9 +53,12 @@ namespace Grpc.Core.Internal |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public void RegisterCompletionQueue(CompletionQueueSafeHandle cq) |
|
|
|
public void RegisterCompletionQueue(CompletionQueueSafeHandle cq) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
using (cq.NewScope()) |
|
|
|
{ |
|
|
|
{ |
|
|
|
Native.grpcsharp_server_register_completion_queue(this, cq); |
|
|
|
Native.grpcsharp_server_register_completion_queue(this, cq); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public int AddInsecurePort(string addr) |
|
|
|
public int AddInsecurePort(string addr) |
|
|
|
{ |
|
|
|
{ |
|
|
@ -73,18 +76,24 @@ namespace Grpc.Core.Internal |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public void ShutdownAndNotify(BatchCompletionDelegate callback, CompletionQueueSafeHandle completionQueue) |
|
|
|
public void ShutdownAndNotify(BatchCompletionDelegate callback, CompletionQueueSafeHandle completionQueue) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
using (completionQueue.NewScope()) |
|
|
|
{ |
|
|
|
{ |
|
|
|
var ctx = BatchContextSafeHandle.Create(); |
|
|
|
var ctx = BatchContextSafeHandle.Create(); |
|
|
|
completionQueue.CompletionRegistry.RegisterBatchCompletion(ctx, callback); |
|
|
|
completionQueue.CompletionRegistry.RegisterBatchCompletion(ctx, callback); |
|
|
|
Native.grpcsharp_server_shutdown_and_notify_callback(this, completionQueue, ctx); |
|
|
|
Native.grpcsharp_server_shutdown_and_notify_callback(this, completionQueue, ctx); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public void RequestCall(BatchCompletionDelegate callback, CompletionQueueSafeHandle completionQueue) |
|
|
|
public void RequestCall(BatchCompletionDelegate callback, CompletionQueueSafeHandle completionQueue) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
using (completionQueue.NewScope()) |
|
|
|
{ |
|
|
|
{ |
|
|
|
var ctx = BatchContextSafeHandle.Create(); |
|
|
|
var ctx = BatchContextSafeHandle.Create(); |
|
|
|
completionQueue.CompletionRegistry.RegisterBatchCompletion(ctx, callback); |
|
|
|
completionQueue.CompletionRegistry.RegisterBatchCompletion(ctx, callback); |
|
|
|
Native.grpcsharp_server_request_call(this, completionQueue, ctx).CheckOk(); |
|
|
|
Native.grpcsharp_server_request_call(this, completionQueue, ctx).CheckOk(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
protected override bool ReleaseHandle() |
|
|
|
protected override bool ReleaseHandle() |
|
|
|
{ |
|
|
|
{ |
|
|
|