static void Main(string[] args) { var server = new Server() { Services = { TodoService.BindService(new GrpcServer()) }, Ports = { new ServerPort("localhost", 5000, ServerCredentials.Insecure) } }; Logger.LogInformation("Starting grpc console server..."); server.Start(); Console.WriteLine("Press Ctrl+C to quit server..."); server.ShutdownTask.Wait(); Logger.LogInformation("Shutdown server..."); Log.Dispose(); }
public static void Main(string[] args) { const int PORT = 5000; var todoImplement = new TodoImplement(new UnitOfWork()); var server = new Server { Services = { TodoService.BindService(todoImplement) }, Ports = { new ServerPort("0.0.0.0", PORT, ServerCredentials.Insecure) } }; server.Start(); Console.WriteLine("gRPC Todo server listening on port " + PORT); Console.WriteLine("Press any key to stop the server..."); Console.Read(); server.ShutdownAsync().Wait(); // CreateWebHostBuilder(args).Build().Run(); }