/// <summary> /// Create a new server. /// </summary> /// <param name="options">Channel options.</param> public Server(IEnumerable<ChannelOption> options = null) { using (var channelArgs = ChannelOptions.CreateChannelArgs(options)) { this.handle = ServerSafeHandle.NewServer(GetCompletionQueue(), channelArgs); } }
/// <summary> /// Create a new server. /// </summary> /// <param name="options">Channel options.</param> public Server(IEnumerable<ChannelOption> options = null) { this.environment = GrpcEnvironment.GetInstance(); using (var channelArgs = ChannelOptions.CreateChannelArgs(options)) { this.handle = ServerSafeHandle.NewServer(environment.CompletionQueue, channelArgs); } }
int IPlatformInvocation.grpcsharp_server_add_secure_http2_port(ServerSafeHandle server, string addr, ServerCredentialsSafeHandle creds) { return grpcsharp_server_add_secure_http2_port(server, addr, creds); }
static extern void grpcsharp_server_shutdown_and_notify_callback(ServerSafeHandle server, CompletionQueueSafeHandle cq, BatchContextSafeHandle ctx);
static extern GRPCCallError grpcsharp_server_request_call(ServerSafeHandle server, CompletionQueueSafeHandle cq, BatchContextSafeHandle ctx);
static extern int grpcsharp_server_add_secure_http2_port(ServerSafeHandle server, string addr, ServerCredentialsSafeHandle creds);
void IPlatformInvocation.grpcsharp_server_shutdown_and_notify_callback(ServerSafeHandle server, CompletionQueueSafeHandle cq, BatchContextSafeHandle ctx) { grpcsharp_server_shutdown_and_notify_callback(server, cq, ctx); }
GRPCCallError IPlatformInvocation.grpcsharp_server_request_call(ServerSafeHandle server, CompletionQueueSafeHandle cq, BatchContextSafeHandle ctx) { return(grpcsharp_server_request_call(server, cq, ctx)); }
static extern void grpcsharp_server_shutdown(ServerSafeHandle server);
static extern GRPCCallError grpcsharp_server_request_call(ServerSafeHandle server, CompletionQueueSafeHandle cq, [MarshalAs(UnmanagedType.FunctionPtr)] CompletionCallbackDelegate callback);
static extern void grpcsharp_server_shutdown_and_notify_CALLBACK(ServerSafeHandle server, [MarshalAs(UnmanagedType.FunctionPtr)] ServerShutdownCallbackDelegate callback);
internal static extern CallError grpcsharp_server_request_call(ServerSafeHandle server, CompletionQueueSafeHandle cq, RequestCallContextSafeHandle ctx);
internal static extern void grpcsharp_server_register_completion_queue(ServerSafeHandle server, CompletionQueueSafeHandle cq);
GRPCCallError IPlatformInvocation.grpcsharp_server_request_call(ServerSafeHandle server, CompletionQueueSafeHandle cq, BatchContextSafeHandle ctx) { return grpcsharp_server_request_call(server, cq, ctx); }
static extern void grpcsharp_server_shutdown_and_notify_callback(ServerSafeHandle server, [MarshalAs(UnmanagedType.FunctionPtr)] CompletionCallbackDelegate callback);
void IPlatformInvocation.grpcsharp_server_start(ServerSafeHandle server) { grpcsharp_server_start(server); }
static extern int grpcsharp_server_add_insecure_http2_port(ServerSafeHandle server, string addr);
void IPlatformInvocation.grpcsharp_server_cancel_all_calls(ServerSafeHandle server) { grpcsharp_server_cancel_all_calls(server); }
static extern void grpcsharp_server_start(ServerSafeHandle server);
static extern void grpcsharp_server_cancel_all_calls(ServerSafeHandle server);
int IPlatformInvocation.grpcsharp_server_add_insecure_http2_port(ServerSafeHandle server, string addr) { return grpcsharp_server_add_insecure_http2_port(server, addr); }
int IPlatformInvocation.grpcsharp_server_add_insecure_http2_port(ServerSafeHandle server, string addr) { return(grpcsharp_server_add_insecure_http2_port(server, addr)); }
int IPlatformInvocation.grpcsharp_server_add_secure_http2_port(ServerSafeHandle server, string addr, ServerCredentialsSafeHandle creds) { return(grpcsharp_server_add_secure_http2_port(server, addr, creds)); }
public Server() { this.handle = ServerSafeHandle.NewServer(GetCompletionQueue(), IntPtr.Zero); this.newServerRpcHandler = HandleNewServerRpc; this.serverShutdownHandler = HandleServerShutdown; }
static extern Int32 grpcsharp_server_add_http2_port(ServerSafeHandle server, string addr);