Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

protobuf service_stub相关 #4

Open
Bluswy opened this issue May 4, 2022 · 1 comment
Open

protobuf service_stub相关 #4

Bluswy opened this issue May 4, 2022 · 1 comment

Comments

@Bluswy
Copy link

Bluswy commented May 4, 2022

测试代码中没有找到继承并实现query_service_stub

@Gooddbird
Copy link
Owner

没有必要继承实现 QueryService_Stub 类呢。 看下 protoc 生成的tinypb.pc.cc 文件里面,QueryService_Stub类 并没有虚函数,其query_name、query_age 方法都是转而调用 RpcChannel 的CallMethod 方法。
RpcChannel 是个抽象类,这个是需要继承并实现的。TinyPbRpcChannel 就是继承实现RpcChannel 这个抽象类的,其代码在tinyrpc/net/tinypb/tinypb_rpc_channel.cc 里面。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants