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

Unified Diff: third_party/grpc/examples/csharp/helloworld/GreeterClient/Program.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/examples/csharp/helloworld/GreeterClient/Program.cs
diff --git a/third_party/tcmalloc/vendor/src/tcmalloc_guard.h b/third_party/grpc/examples/csharp/helloworld/GreeterClient/Program.cs
similarity index 69%
copy from third_party/tcmalloc/vendor/src/tcmalloc_guard.h
copy to third_party/grpc/examples/csharp/helloworld/GreeterClient/Program.cs
index 7874dadaea9882b49a015ef5e125345d89e71e95..ffc7fabbf12ac68ef39474203dcc261c08ddbe4c 100644
--- a/third_party/tcmalloc/vendor/src/tcmalloc_guard.h
+++ b/third_party/grpc/examples/csharp/helloworld/GreeterClient/Program.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2005, Google Inc.
+// Copyright 2015-2016, Google Inc.
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
@@ -27,22 +27,27 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-// ---
-// Author: Craig Silverstein
-//
-// We expose the TCMallocGuard class -- which initializes the tcmalloc
-// allocator -- so classes that need to be sure tcmalloc is loaded
-// before they do stuff -- notably heap-profiler -- can. To use this
-// create a static TCMallocGuard instance at the top of a file where
-// you need tcmalloc to be initialized before global constructors run.
+using System;
+using Grpc.Core;
+using Helloworld;
+
+namespace GreeterClient
+{
+ class Program
+ {
+ public static void Main(string[] args)
+ {
+ Channel channel = new Channel("127.0.0.1:50051", ChannelCredentials.Insecure);
-#ifndef TCMALLOC_TCMALLOC_GUARD_H_
-#define TCMALLOC_TCMALLOC_GUARD_H_
+ var client = Greeter.NewClient(channel);
+ String user = "you";
-class TCMallocGuard {
- public:
- TCMallocGuard();
- ~TCMallocGuard();
-};
+ var reply = client.SayHello(new HelloRequest { Name = user });
+ Console.WriteLine("Greeting: " + reply.Message);
-#endif // TCMALLOC_TCMALLOC_GUARD_H_
+ channel.ShutdownAsync().Wait();
+ Console.WriteLine("Press any key to exit...");
+ Console.ReadKey();
+ }
+ }
+}

Powered by Google App Engine
This is Rietveld 408576698