public void Handle(SystemMessage.SystemInit message)
 {
     _server = new Server {
         Services = { StreamService.BindService(new RxStreamService(_publisher)) },
         Ports    = { _serverPort }
     };
     Log.Info("Initialized gRpc server");
 }
Exemple #2
0
        public static void Main(string[] args)
        {
            var server = new GrpcServer
            {
                Services = { StreamService.BindService(new QueryService()) },
                Ports    = { new ServerPort("127.0.0.1", Port, ServerCredentials.Insecure) }
            };

            server.Start();

            Console.WriteLine("Grpc server listening on port " + Port);
            Console.WriteLine("Press any key to stop the server...");
            Console.ReadKey();

            server.ShutdownAsync().Wait();
        }