aboutsummaryrefslogtreecommitdiffhomepage
path: root/examples/csharp/route_guide/RouteGuideServer/Program.cs
diff options
context:
space:
mode:
authorGravatar Julien Boeuf <jboeuf@google.com>2015-08-27 16:07:46 -0700
committerGravatar Julien Boeuf <jboeuf@google.com>2015-08-27 16:07:46 -0700
commit459faf3821b74329f5f1debdba21abe03e3a6e74 (patch)
tree2046a5d7f4f119f0770154393c4308394f26f19b /examples/csharp/route_guide/RouteGuideServer/Program.cs
parent35b559f6f7e4e6410613632bbfe3f2ab84073feb (diff)
parent1029e7049cea55a8880b8fe9167bd3f0e483b037 (diff)
Merge branch 'master' of github.com:grpc/grpc into cpp_auth_md_processor
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();
+ }
+ }
+}