Skip to content

feat(net): multi & managed for recvfrom & recvmsg#838

Open
Berrysoft wants to merge 3 commits intocompio-rs:masterfrom
Berrysoft:dev/iour-recvmsg
Open

feat(net): multi & managed for recvfrom & recvmsg#838
Berrysoft wants to merge 3 commits intocompio-rs:masterfrom
Berrysoft:dev/iour-recvmsg

Conversation

@Berrysoft
Copy link
Copy Markdown
Member

@Berrysoft Berrysoft commented Apr 5, 2026

Closes #833

Needs #832, #842, #843

This PR adds recv_from_multi, recv_msg_managed, and recv_msg_multi.

  • recv_msg_managed requires a user-provided, not managed buffer for the cmsg.
  • The multishot ops returns a custom result type to unify different platforms. It is a single buffer on io-uring, but multiple buffers on other platforms.

@Berrysoft Berrysoft requested a review from Copilot April 5, 2026 19:25
@Berrysoft Berrysoft self-assigned this Apr 5, 2026
@Berrysoft Berrysoft added package: net Related to compio-net package: driver Related to compio-driver package: io Related to compio-io labels Apr 5, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds managed and multishot receive APIs (including ancillary-aware variants) across compio-driver, compio-net, and compio-runtime, introducing unified result wrapper types to smooth over platform differences (io-uring single-buffer layout vs other backends).

Changes:

  • Introduce driver-level ops/results for recv_from_multi, recv_msg_managed, and recv_msg_multi (poll/iour/iocp/stub + fusion wrappers).
  • Extend runtime multishot stream handling to construct custom managed result items (RecvFromMultiResult, RecvMsgMultiResult).
  • Add net-level public APIs + ancillary read traits for TCP/Unix streams, plus a new UDP recv_from_multi test.

Reviewed changes

Copilot reviewed 15 out of 15 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
compio-runtime/src/future/stream.rs Generalize multishot managed stream item handling to support custom result wrappers.
compio-net/tests/buffer_pool.rs Add coverage for new UDP multishot recv_from_multi.
compio-net/src/unix.rs Implement ancillary managed/multi read traits for UnixStream using new recvmsg ops.
compio-net/src/udp.rs Expose recv_from_multi, recv_msg_managed, and recv_msg_multi on UdpSocket.
compio-net/src/tcp.rs Implement ancillary managed/multi read traits for TcpStream using new recvmsg ops.
compio-net/src/socket.rs Wire socket-level managed/multi recv APIs to runtime submit/submit_multi.
compio-io/src/ancillary/io.rs Add new ancillary read traits for managed buffers and multi streams.
compio-driver/src/sys/stub/op.rs Add stub-backend OpCode impls for newly introduced managed/multi ops.
compio-driver/src/sys/poll/op.rs Add polling-backend OpCode impls and refactor recv/send msg control storage.
compio-driver/src/sys/iour/op/mod.rs Export new iour managed/multi recv ops and adjust recvfrom/sendto control handling.
compio-driver/src/sys/iour/op/managed.rs Implement io-uring managed recvmsg + multishot recvmsg/recvfrom result parsing.
compio-driver/src/sys/iocp/op.rs Add IOCP OpCode impls for new managed/multi ops.
compio-driver/src/sys/fusion/op.rs Add fused ops + unified result wrapper types for cross-backend API consistency.
compio-driver/src/op/mod.rs Re-export new managed/multi recv ops across cfgs.
compio-driver/src/op/managed.rs Add non-io_uring managed/multi recv ops and result wrapper types.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@Berrysoft Berrysoft marked this pull request as ready for review April 6, 2026 19:03
@Berrysoft Berrysoft requested a review from George-Miao April 6, 2026 19:05
@George-Miao
Copy link
Copy Markdown
Member

Let's split this into two PR's, one for driver and one for net

@Berrysoft
Copy link
Copy Markdown
Member Author

OK. I'll split it.

@Berrysoft Berrysoft changed the title feat(driver,net): multi & managed for recvfrom & recvmsg feat(net): multi & managed for recvfrom & recvmsg Apr 10, 2026
@Berrysoft Berrysoft requested a review from Copilot April 10, 2026 08:25
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@Berrysoft Berrysoft requested review from George-Miao and removed request for George-Miao April 10, 2026 08:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

package: driver Related to compio-driver package: io Related to compio-io package: net Related to compio-net

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Need some special design for managed and multishot recvmsg

3 participants