diff options
author | Yang Gao <yangg@google.com> | 2016-09-29 13:39:12 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-09-29 13:39:12 -0700 |
commit | d24b822d73c8608a4838c8887d7ecddf39c324a0 (patch) | |
tree | dcf937357fcbabbdf2b722bd38ec50d40974ad77 /src/cpp | |
parent | ef49a5d2171b77e3ac4ca069b8d2a16c27248f61 (diff) | |
parent | dbdc6e4ae619225a555849569f04af5575a5f99f (diff) |
Merge pull request #8046 from gislan/master
Add method for creating insecure channel from FD with custom arguments using C++ API.
Diffstat (limited to 'src/cpp')
-rw-r--r-- | src/cpp/client/create_channel_posix.cc | 10 |
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 |