|
|
|
@ -24,45 +24,45 @@ |
|
|
|
|
|
|
|
|
|
#include "src/cpp/client/create_channel_internal.h" |
|
|
|
|
|
|
|
|
|
namespace grpc { |
|
|
|
|
namespace grpc_impl { |
|
|
|
|
|
|
|
|
|
#ifdef GPR_SUPPORT_CHANNELS_FROM_FD |
|
|
|
|
|
|
|
|
|
std::shared_ptr<Channel> CreateInsecureChannelFromFd(const grpc::string& target, |
|
|
|
|
std::shared_ptr<grpc::Channel> CreateInsecureChannelFromFd(const grpc::string& target, |
|
|
|
|
int fd) { |
|
|
|
|
internal::GrpcLibrary init_lib; |
|
|
|
|
grpc::internal::GrpcLibrary init_lib; |
|
|
|
|
init_lib.init(); |
|
|
|
|
return CreateChannelInternal( |
|
|
|
|
return grpc::CreateChannelInternal( |
|
|
|
|
"", grpc_insecure_channel_create_from_fd(target.c_str(), fd, nullptr), |
|
|
|
|
std::vector< |
|
|
|
|
std::unique_ptr<experimental::ClientInterceptorFactoryInterface>>()); |
|
|
|
|
std::unique_ptr<grpc::experimental::ClientInterceptorFactoryInterface>>()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
std::shared_ptr<Channel> CreateCustomInsecureChannelFromFd( |
|
|
|
|
const grpc::string& target, int fd, const ChannelArguments& args) { |
|
|
|
|
internal::GrpcLibrary init_lib; |
|
|
|
|
std::shared_ptr<grpc::Channel> CreateCustomInsecureChannelFromFd( |
|
|
|
|
const grpc::string& target, int fd, const grpc::ChannelArguments& args) { |
|
|
|
|
grpc::internal::GrpcLibrary init_lib; |
|
|
|
|
init_lib.init(); |
|
|
|
|
grpc_channel_args channel_args; |
|
|
|
|
args.SetChannelArgs(&channel_args); |
|
|
|
|
return CreateChannelInternal( |
|
|
|
|
return grpc::CreateChannelInternal( |
|
|
|
|
"", |
|
|
|
|
grpc_insecure_channel_create_from_fd(target.c_str(), fd, &channel_args), |
|
|
|
|
std::vector< |
|
|
|
|
std::unique_ptr<experimental::ClientInterceptorFactoryInterface>>()); |
|
|
|
|
std::unique_ptr<grpc::experimental::ClientInterceptorFactoryInterface>>()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
namespace experimental { |
|
|
|
|
|
|
|
|
|
std::shared_ptr<Channel> CreateCustomInsecureChannelWithInterceptorsFromFd( |
|
|
|
|
const grpc::string& target, int fd, const ChannelArguments& args, |
|
|
|
|
std::shared_ptr<grpc::Channel> CreateCustomInsecureChannelWithInterceptorsFromFd( |
|
|
|
|
const grpc::string& target, int fd, const grpc::ChannelArguments& args, |
|
|
|
|
std::vector< |
|
|
|
|
std::unique_ptr<experimental::ClientInterceptorFactoryInterface>> |
|
|
|
|
std::unique_ptr<grpc::experimental::ClientInterceptorFactoryInterface>> |
|
|
|
|
interceptor_creators) { |
|
|
|
|
internal::GrpcLibrary init_lib; |
|
|
|
|
grpc::internal::GrpcLibrary init_lib; |
|
|
|
|
init_lib.init(); |
|
|
|
|
grpc_channel_args channel_args; |
|
|
|
|
args.SetChannelArgs(&channel_args); |
|
|
|
|
return CreateChannelInternal( |
|
|
|
|
return grpc::CreateChannelInternal( |
|
|
|
|
"", |
|
|
|
|
grpc_insecure_channel_create_from_fd(target.c_str(), fd, &channel_args), |
|
|
|
|
std::move(interceptor_creators)); |
|
|
|
@ -72,4 +72,4 @@ std::shared_ptr<Channel> CreateCustomInsecureChannelWithInterceptorsFromFd( |
|
|
|
|
|
|
|
|
|
#endif // GPR_SUPPORT_CHANNELS_FROM_FD
|
|
|
|
|
|
|
|
|
|
} // namespace grpc
|
|
|
|
|
} // namespace grpc_impl
|
|
|
|
|