Comments (2)
你好,感谢你的分析!不知道我对你的描述理解是否正确。但我感觉不会存在这个问题,原因在于框架的流程:
- 服务器开始处理,构造了RPCServerTask,其中RPCRequest和RPCResponse都是它的成员,它们的生命周期持续到当前'处理'的任务流SeriesWork结束;
- 框架开始按照BRPC协议收RPCRequest类,在你说的cut函数拿到了message和attachment;
- 框架调用用户的处理函数比如Echo(),服务器要返回的内容和要回复的attachment会设置到RPCResponse上;
- RPCResponse被调用encode(),按照BRPC协议告诉框架怎么发出;
由于会被encode的是服务器的Response,而收的时候被cut的是Request,是两个不一样的RPCMessage,所以不会有你所说的问题。
不过你说的隐含条件是对的,使用上确实需要非常小心。也许应该对RPCBuffer做一些其他机制尽量避免用错。非常欢迎提出更多讨论和建议!
from srpc.
感谢您的回答,确实混淆了 RPCRequest 和 RPCResponse。
from srpc.
Related Issues (20)
- 在SRPCHttpServer上启用trace上报opentelemtry功能异常 HOT 6
- 关于 RPCBuffer 中 read_back 问题 HOT 3
- 是否计划支持linux io_uring? HOT 3
- SRPC性能测试问题 HOT 25
- client.Echo start multi thread,how can I start only one thread? HOT 6
- thrift oneway 无法正确解析 HOT 2
- list<bool>和map返回值不能正确处理 HOT 16
- 想问一下srpc会存在粘包问题么? HOT 1
- in sync mode,It took a long time to get data from server,how can I debug? HOT 18
- srpc::ThriftClient 是否可以访问原生thrift的TMultiplexedProcessor HOT 1
- 有2层namespace时,生成代码出错 HOT 3
- 关于一个server有多个service,不能正常访问 HOT 9
- SRPC支持自定义拦截器吗 HOT 11
- SRPC Http客户端与服务端参数不一致问题 HOT 2
- openeuler下编译时会报错C++标准,建议更新C++标准从11到14 HOT 3
- 应该如何正确的报错呢? HOT 1
- SRPCHttpServer中不支持自定url映射方法 HOT 3
- Protobuf v5 support HOT 4
- 在arm上的编译问题 HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from srpc.