Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(178)

Unified Diff: third_party/grpc/src/csharp/Grpc.Examples.MathServer/MathServer.cs

Issue 1932353002: Initial checkin of gRPC to third_party/ Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/grpc/src/csharp/Grpc.Examples.MathServer/MathServer.cs
diff --git a/third_party/protobuf/csharp/src/Google.Protobuf.Test/SampleEnum.cs b/third_party/grpc/src/csharp/Grpc.Examples.MathServer/MathServer.cs
similarity index 66%
copy from third_party/protobuf/csharp/src/Google.Protobuf.Test/SampleEnum.cs
copy to third_party/grpc/src/csharp/Grpc.Examples.MathServer/MathServer.cs
index 77447afa127340046298081d9bfca4dd51c14f6c..6e974a08710cd64e8dd7870a06d45d05c9f6cd74 100644
--- a/third_party/protobuf/csharp/src/Google.Protobuf.Test/SampleEnum.cs
+++ b/third_party/grpc/src/csharp/Grpc.Examples.MathServer/MathServer.cs
@@ -1,7 +1,6 @@
#region Copyright notice and license
-// Protocol Buffers - Google's data interchange format
-// Copyright 2015 Google Inc. All rights reserved.
-// https://developers.google.com/protocol-buffers/
+// Copyright 2015, Google Inc.
+// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
@@ -29,14 +28,34 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#endregion
-
-namespace Google.Protobuf
+
+using System;
+using System.Runtime.InteropServices;
+using System.Threading;
+using Grpc.Core;
+
+namespace Math
{
- // Just a sample enum with positive and negative values to be used in tests.
- internal enum SampleEnum
+ class MainClass
{
- NegativeValue = -2,
- None = 0,
- PositiveValue = 3
+ const string Host = "0.0.0.0";
+ const int Port = 23456;
+
+ public static void Main(string[] args)
+ {
+ Server server = new Server
+ {
+ Services = { Math.BindService(new MathServiceImpl()) },
+ Ports = { { Host, Port, ServerCredentials.Insecure } }
+ };
+ server.Start();
+
+ Console.WriteLine("MathServer listening on port " + Port);
+
+ Console.WriteLine("Press any key to stop the server...");
+ Console.ReadKey();
+
+ server.ShutdownAsync().Wait();
+ }
}
}

Powered by Google App Engine
This is Rietveld 408576698