aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/csharp/GrpcCore/Internal/ServerSafeHandle.cs
diff options
context:
space:
mode:
authorGravatar Jan Tattermusch <jtattermusch@google.com>2015-02-05 10:56:49 -0800
committerGravatar Jan Tattermusch <jtattermusch@google.com>2015-02-05 11:10:06 -0800
commit8ce5e8bbccc4b2d0e7e3b26fe857c105ba68943e (patch)
tree9cb75e486ccaaa3d6047c03a21193d2ebfb26875 /src/csharp/GrpcCore/Internal/ServerSafeHandle.cs
parent6b9afb153a82c921c7e80365a4e129c462c0ebad (diff)
Improved the server implementation to be able to register call handlers, also some refactoring
Diffstat (limited to 'src/csharp/GrpcCore/Internal/ServerSafeHandle.cs')
-rw-r--r--src/csharp/GrpcCore/Internal/ServerSafeHandle.cs9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/csharp/GrpcCore/Internal/ServerSafeHandle.cs b/src/csharp/GrpcCore/Internal/ServerSafeHandle.cs
index 0d38bce63e..08d4cf0192 100644
--- a/src/csharp/GrpcCore/Internal/ServerSafeHandle.cs
+++ b/src/csharp/GrpcCore/Internal/ServerSafeHandle.cs
@@ -30,8 +30,8 @@ namespace Google.GRPC.Core.Internal
[DllImport("libgrpc.so")]
static extern void grpc_server_shutdown(ServerSafeHandle server);
- [DllImport("libgrpc.so")]
- static extern void grpc_server_shutdown_and_notify(ServerSafeHandle server, IntPtr tag);
+ [DllImport("libgrpc.so", EntryPoint = "grpc_server_shutdown_and_notify")]
+ static extern void grpc_server_shutdown_and_notify_CALLBACK(ServerSafeHandle server, [MarshalAs(UnmanagedType.FunctionPtr)] EventCallbackDelegate callback);
[DllImport("libgrpc.so")]
static extern void grpc_server_destroy(IntPtr server);
@@ -62,6 +62,11 @@ namespace Google.GRPC.Core.Internal
grpc_server_shutdown(this);
}
+ public void ShutdownAndNotify(EventCallbackDelegate callback)
+ {
+ grpc_server_shutdown_and_notify_CALLBACK(this, callback);
+ }
+
public GRPCCallError RequestCall(EventCallbackDelegate callback)
{
return grpc_server_request_call_old_CALLBACK(this, callback);