diff options
Diffstat (limited to 'src/cpp/client/create_channel_posix.cc')
-rw-r--r-- | src/cpp/client/create_channel_posix.cc | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/cpp/client/create_channel_posix.cc b/src/cpp/client/create_channel_posix.cc index b9e5887bcc..8d775e7a87 100644 --- a/src/cpp/client/create_channel_posix.cc +++ b/src/cpp/client/create_channel_posix.cc @@ -49,6 +49,25 @@ std::shared_ptr<Channel> CreateCustomInsecureChannelFromFd( nullptr); } +namespace experimental { + +std::shared_ptr<Channel> CreateCustomInsecureChannelWithInterceptorsFromFd( + const grpc::string& target, int fd, const ChannelArguments& args, + std::unique_ptr<std::vector< + std::unique_ptr<experimental::ClientInterceptorFactoryInterface>>> + interceptor_creators) { + 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), + std::move(interceptor_creators)); +} + +} // namespace experimental + #endif // GPR_SUPPORT_CHANNELS_FROM_FD } // namespace grpc |