RegisterServer() static private method

static private RegisterServer ( Grpc.Core.Server server ) : void
server Grpc.Core.Server
return void
Beispiel #1
0
        /// <summary>
        /// Creates a new server.
        /// </summary>
        /// <param name="options">Channel options.</param>
        public Server(IEnumerable <ChannelOption> options)
        {
            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(channelArgs);
            }

            foreach (var cq in environment.CompletionQueues)
            {
                this.handle.RegisterCompletionQueue(cq);
            }
            GrpcEnvironment.RegisterServer(this);
        }