aboutsummaryrefslogtreecommitdiffhomepage
path: root/examples/csharp/route_guide/RouteGuideServer/Program.cs
diff options
context:
space:
mode:
authorGravatar Stanley Cheung <stanleycheung@google.com>2015-08-27 14:00:20 -0700
committerGravatar Stanley Cheung <stanleycheung@google.com>2015-08-27 14:00:20 -0700
commit20fa6693f3836bf1418176ec78b26feaf51a369d (patch)
tree5975f66d7c6eb447baeea97fb62cdffa19d5c2e5 /examples/csharp/route_guide/RouteGuideServer/Program.cs
parentb2bea23365acb0bcc1b5adba2d5b2fa5a22eb872 (diff)
move examples to correct locations
Diffstat (limited to 'examples/csharp/route_guide/RouteGuideServer/Program.cs')
-rw-r--r--examples/csharp/route_guide/RouteGuideServer/Program.cs30
1 files changed, 30 insertions, 0 deletions
diff --git a/examples/csharp/route_guide/RouteGuideServer/Program.cs b/examples/csharp/route_guide/RouteGuideServer/Program.cs
new file mode 100644
index 0000000000..e00b4d6723
--- /dev/null
+++ b/examples/csharp/route_guide/RouteGuideServer/Program.cs
@@ -0,0 +1,30 @@
+using Grpc.Core;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace examples
+{
+ class Program
+ {
+ static void Main(string[] args)
+ {
+ var features = RouteGuideUtil.ParseFeatures(RouteGuideUtil.DefaultFeaturesFile);
+ GrpcEnvironment.Initialize();
+
+ Server server = new Server();
+ server.AddServiceDefinition(RouteGuide.BindService(new RouteGuideImpl(features)));
+ int port = server.AddListeningPort("localhost", 50052);
+ server.Start();
+
+ Console.WriteLine("RouteGuide server listening on port " + port);
+ Console.WriteLine("Press any key to stop the server...");
+ Console.ReadKey();
+
+ server.ShutdownAsync().Wait();
+ GrpcEnvironment.Shutdown();
+ }
+ }
+}