aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/cpp/client/create_channel_posix.cc
diff options
context:
space:
mode:
authorGravatar Adam Czachorowski <adamcz@google.com>2016-09-09 11:32:09 +0200
committerGravatar Adam Czachorowski <adamcz@google.com>2016-09-09 11:32:09 +0200
commitdbdc6e4ae619225a555849569f04af5575a5f99f (patch)
treed39d34423ac3465772bc04864964b6ee16b0a71b /src/cpp/client/create_channel_posix.cc
parent93b09478f0264f62e577b215dea7bc908abc6b98 (diff)
Add method for creating insecure channel from FD with custom arguments
using C++ API. This was already supported in C API.
Diffstat (limited to 'src/cpp/client/create_channel_posix.cc')
-rw-r--r--src/cpp/client/create_channel_posix.cc10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/cpp/client/create_channel_posix.cc b/src/cpp/client/create_channel_posix.cc
index 60cfed3d62..eb323ac50b 100644
--- a/src/cpp/client/create_channel_posix.cc
+++ b/src/cpp/client/create_channel_posix.cc
@@ -51,6 +51,16 @@ std::shared_ptr<Channel> CreateInsecureChannelFromFd(const grpc::string& target,
"", grpc_insecure_channel_create_from_fd(target.c_str(), fd, nullptr));
}
+std::shared_ptr<Channel> CreateCustomInsecureChannelFromFd(
+ const grpc::string& target, int fd, const ChannelArguments& args) {
+ internal::GrpcLibrary init_lib;
+ init_lib.init();
+ grpc_channel_args channel_args;
+ args.SetChannelArgs(&channel_args);
+ return CreateChannelInternal("", grpc_insecure_channel_create_from_fd(
+ target.c_str(), fd, &channel_args));
+}
+
#endif // GPR_SUPPORT_CHANNELS_FROM_FD
} // namespace grpc