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

能不能支持每次收到的数据直接写道提前准备好的缓冲区里 #415

Closed
MagiciSource opened this issue Aug 14, 2023 · 2 comments

Comments

@MagiciSource
Copy link

RTP这种应用后期还需要排序,每个UDP包收到之后还得先单独存着,排序之后再拷贝到一个大的缓冲区里汇总,如果调用recvfrom从系统协议栈里收数据的时候就存到malloc的地址里,能少复制一次数据

@MagiciSource
Copy link
Author

MagiciSource commented Aug 14, 2023

啊,我直接调用底层的接口好像就可以了,上层接口能不能考虑实现这种需求,好像有点麻烦

@ithewei
Copy link
Owner

ithewei commented Aug 15, 2023

确实是比较底层的接口,可以这样调用:

hio_t* io = udp->channel->io();
hio_set_readbuf(io, buf, len);

ithewei added a commit that referenced this issue Oct 23, 2023
@ithewei ithewei closed this as completed Oct 23, 2023
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