You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@brpc.apache.org by "wwbmmm (via GitHub)" <gi...@apache.org> on 2023/02/10 11:18:18 UTC

[GitHub] [brpc] wwbmmm commented on issue #2120: IOBuf是否能支持连续的内存避免内存拷贝

wwbmmm commented on issue #2120:
URL: https://github.com/apache/brpc/issues/2120#issuecomment-1425655728

   > > 可以看看IOBuf的append_user_data函数
   > 
   > 我在数据发送端通过append_user_data避免了发送端的数据拷贝,但是在接收端拿到的就是IOBuf,从网络拿到的数据放到IOBuf这一步已经是不连续的内存了,这里接收端能保证接收到连续的内存来避免拷贝吗
   
   如果要接收端能拿到连续的buf,意味着接收端在接收body之前,需要从协议头里获取body的长度,然后分配出相应长度的内存,再用这段内存来接收网络数据。这个逻辑应该是协议相关的,需要修改协议的实现,仅仅改IOBuf是不够的


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@brpc.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@brpc.apache.org
For additional commands, e-mail: dev-help@brpc.apache.org