diff options
author | Stanley Cheung <stanleycheung@google.com> | 2015-08-27 13:53:42 -0700 |
---|---|---|
committer | Stanley Cheung <stanleycheung@google.com> | 2015-08-27 13:53:42 -0700 |
commit | 6905915db1fe4b66e40f03014f7f14c74f3fee16 (patch) | |
tree | 0490cd52ebcaa391df484b84bd947b406bc2b55b /grpc-common/csharp/route_guide/RouteGuideServer/Program.cs | |
parent | 209d047db80a2c289fc24b3fafd85945dbcfb543 (diff) |
prepare for move
Diffstat (limited to 'grpc-common/csharp/route_guide/RouteGuideServer/Program.cs')
-rw-r--r-- | grpc-common/csharp/route_guide/RouteGuideServer/Program.cs | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/grpc-common/csharp/route_guide/RouteGuideServer/Program.cs b/grpc-common/csharp/route_guide/RouteGuideServer/Program.cs new file mode 100644 index 0000000000..e00b4d6723 --- /dev/null +++ b/grpc-common/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(); + } + } +} |