private static void startServer(int port) { var server = new Server { Services = { Benchmarker.BindService(new BenchmarkerImpl()) }, Ports = { new ServerPort("localhost", port, ServerCredentials.Insecure) } }; server.Start(); Console.WriteLine("Benchmark server listening on port " + port); while (!ShutdownRequested) { Task.Delay(1000).Wait(); } server.ShutdownAsync().Wait(); }