admin管理员组文章数量:1392105
I'm trying to see if u_ring
can be used for networking. So far, nothing works.
Here is what I'm trying... I have a simple TCP/IP server that should receive some data from a client. That server is using liburing.
Basically I do this:
I use io_uring_register_buffers(); to register 10 buffers, each 4096 bytes long. It is actually one contiguous buffer, so I provide different offsets while registering. After calling listen() on the socket I prepare an accept request with io_uring_prep_accept() and I submit it successfully. Once a client connects, io_uring_wait_cqe() returns a CQE, while handling it I also do io_uring_prep_recv_multishot() and I submit it, successfully. According to the documentation, io_uring_prep_recv_multishot() expects zero for the length, which I passed. Btw, before submitting a multishot request, I also do this:
sqe->flags |= IOSQE_BUFFER_SELECT; sqe->buf_group = 0; // Group ID 0
The second CQE that I receive is the multishot one (accept was the first one). But, this CQE carries failure. The res is -105, which means "No buffer space available". At the same time the connected client sends data, but I cannot retrieve it no matter what.
I'm not able to find some meaningful documentation on all this, so if anyone can help, I would appreciate it.
本文标签: linuxCan we use iouringregisterbuffers() with iouringpreprecvmultishot()Stack Overflow
版权声明:本文标题:linux - Can we use io_uring_register_buffers() with io_uring_prep_recv_multishot()? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744775512a2624598.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论