aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/cpp/client/create_channel.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/cpp/client/create_channel.cc')
-rw-r--r--src/cpp/client/create_channel.cc19
1 files changed, 10 insertions, 9 deletions
diff --git a/src/cpp/client/create_channel.cc b/src/cpp/client/create_channel.cc
index 5ae772f096..8c571cbbaa 100644
--- a/src/cpp/client/create_channel.cc
+++ b/src/cpp/client/create_channel.cc
@@ -34,15 +34,16 @@
#include <memory>
#include <sstream>
-#include "src/cpp/client/channel.h"
-#include <grpc++/channel_interface.h>
-#include <grpc++/channel_arguments.h>
+#include <grpc++/channel.h>
#include <grpc++/create_channel.h>
+#include <grpc++/support/channel_arguments.h>
+
+#include "src/cpp/client/create_channel_internal.h"
namespace grpc {
class ChannelArguments;
-std::shared_ptr<ChannelInterface> CreateChannel(
+std::shared_ptr<Channel> CreateChannel(
const grpc::string& target, const std::shared_ptr<Credentials>& creds,
const ChannelArguments& args) {
ChannelArguments cp_args = args;
@@ -50,10 +51,10 @@ std::shared_ptr<ChannelInterface> CreateChannel(
user_agent_prefix << "grpc-c++/" << grpc_version_string();
cp_args.SetString(GRPC_ARG_PRIMARY_USER_AGENT_STRING,
user_agent_prefix.str());
- return creds ? creds->CreateChannel(target, cp_args)
- : std::shared_ptr<ChannelInterface>(
- new Channel(grpc_lame_client_channel_create(
- NULL, GRPC_STATUS_INVALID_ARGUMENT,
- "Invalid credentials.")));
+ return creds
+ ? creds->CreateChannel(target, cp_args)
+ : CreateChannelInternal("", grpc_lame_client_channel_create(
+ NULL, GRPC_STATUS_INVALID_ARGUMENT,
+ "Invalid credentials."));
}
} // namespace grpc