public static void Main() { var server = new Server { Services = { RouteGuide.BindService(new RouteGuideImpl(_featuresSeed)) }, Ports = { new ServerPort("localhost", Port, ServerCredentials.Insecure) } }; server.Start(); Console.WriteLine("RouteGuide server listening on port " + Port); Console.WriteLine("Press any key to stop the server..."); Console.ReadKey(); server.ShutdownAsync().Wait(); }
static void Main(string[] args) { const int Port = 50052; var features = RouteGuideUtil.ParseFeatures(RouteGuideUtil.DefaultFeaturesFile); Grpc.Core.Server server = new Grpc.Core.Server { Services = { RouteGuide.BindService(new RouteGuideImpl(features)) }, Ports = { new ServerPort("localhost", Port, ServerCredentials.Insecure) } }; server.Start(); Console.WriteLine("RouteGuide server listening on port " + Port); Console.WriteLine("Press any key to stop the server..."); Console.ReadKey(); server.ShutdownAsync().Wait(); }
public static void Main(string[] args) { var helloWorldService = new HelloWorldService(); var routeGuideService = new RouteGuideService(); routeGuideService.OnReceived += OnReceived; Server server = new Server { Services = { HelloWorld.BindService(helloWorldService), RouteGuide.BindService(routeGuideService) }, Ports = { new ServerPort("localhost", Port, ServerCredentials.Insecure) } }; server.Start(); Console.WriteLine("Greeter server listening v1.0.2 on port " + Port); Console.WriteLine("Press any key to stop the server..."); Console.ReadKey(); server.ShutdownAsync().Wait(); }
public RouteGuideClient(RouteGuide.IRouteGuideClient client) { this.client = client; }