/// <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); } }
/// <summary> /// Create a new server. /// </summary> /// <param name="options">Channel options.</param> public Server(IEnumerable <ChannelOption> options = null) { this.serviceDefinitions = new ServiceDefinitionCollection(this); this.ports = new ServerPortCollection(this); this.environment = GrpcEnvironment.AddRef(); this.options = options != null ? new List <ChannelOption>(options) : new List <ChannelOption>(); using (var channelArgs = ChannelOptions.CreateChannelArgs(this.options)) { this.handle = ServerSafeHandle.NewServer(environment.CompletionQueue, channelArgs); } }
public Server() { this.handle = ServerSafeHandle.NewServer(GetCompletionQueue(), IntPtr.Zero); this.newServerRpcHandler = HandleNewServerRpc; this.serverShutdownHandler = HandleServerShutdown; }