grpc Unary模式下客户端创建insecure channel的主要流程


(原创)C/C++语言, 平台是debian10, grpc版本:grpc-c++/1.25.0-dev grpc-c/8.0.0, 使用的例子是自带的例子GreeterClient

grpc Unary模式下客户端创建insecure channel的主要流程

graph TD; 001(main #greeter_client.cc:81 入口调用grpc::CreateChannel)-->002(grpc::CreateChannel #create_channel.h:30 调用::grpc_impl::CreateChannelImpl) 002-->003(grpc_impl::CreateChannelImpl #create_channel.cc:33 调用CreateCustomChannelImpl) 003-->004(grpc_impl::CreateCustomChannelImpl #create_channel.cc:50 初始化GrpcLibraryCodegen并最终调用grpc_init初始化核心模块, 再调用CreateChannelImpl) 004-->005(grpc_impl::InsecureChannelCredentialsImpl::CreateChannelImpl #insecure_credentials.cc:37 调用CreateChannelWithInterceptors) 005-->006(grpc_impl::InsecureChannelCredentialsImpl::CreateChannelWithInterceptors insecure_credentials.cc:50 调用grpc_insecure_channel_create) 006-->007(grpc_insecure_channel_create #channel_create.cc:104 增加了grpc.client_channel_factory参数并调用CreateChannel) 007-->008(grpc_core::CreateChannel #channel_create.cc:67 增加了grpc.server_uri参数并调用grpc_channel_create) 008-->009(grpc_channel_create #channel.cc:286 调用grpc_init, 此处不会执行初始化,因为前面已经初始化了,创建并设置grpc_channel_stack_builder参数,创建ChannelzNode,最后调用 grpc_channel_create_with_builder) 009-->010(grpc_channel_create_with_builder #channel.cc:79 调用grpc_channel_stack_builder_finish完成channel创建并设置channel的变量) 010-->011(grpc_channel_stack_builder_finish #channel_stack_builder.cc:297 创建并初始化channel对应的grpc_channel_stack)


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM