aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/cpp/client/channel.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/cpp/client/channel.cc')
-rw-r--r--src/cpp/client/channel.cc17
1 files changed, 11 insertions, 6 deletions
diff --git a/src/cpp/client/channel.cc b/src/cpp/client/channel.cc
index c7974d655b..ae20392d11 100644
--- a/src/cpp/client/channel.cc
+++ b/src/cpp/client/channel.cc
@@ -1,6 +1,6 @@
/*
*
- * Copyright 2015, Google Inc.
+ * Copyright 2015-2016, Google Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -35,24 +35,29 @@
#include <memory>
-#include <grpc/grpc.h>
-#include <grpc/support/log.h>
-#include <grpc/support/slice.h>
#include <grpc++/client_context.h>
#include <grpc++/completion_queue.h>
-#include <grpc++/security/credentials.h>
#include <grpc++/impl/call.h>
+#include <grpc++/impl/codegen/completion_queue_tag.h>
+#include <grpc++/impl/grpc_library.h>
#include <grpc++/impl/rpc_method.h>
+#include <grpc++/security/credentials.h>
#include <grpc++/support/channel_arguments.h>
#include <grpc++/support/config.h>
#include <grpc++/support/status.h>
#include <grpc++/support/time.h>
+#include <grpc/grpc.h>
+#include <grpc/support/log.h>
+#include <grpc/support/slice.h>
#include "src/core/profiling/timers.h"
namespace grpc {
+static internal::GrpcLibraryInitializer g_gli_initializer;
Channel::Channel(const grpc::string& host, grpc_channel* channel)
- : host_(host), c_channel_(channel) {}
+ : host_(host), c_channel_(channel) {
+ g_gli_initializer.summon();
+}
Channel::~Channel() { grpc_channel_destroy(c_channel_); }