Open Tuetuopay opened 8 months ago
The addition of {recv,send}mmsg would certainly be accepted. I'm afraid currently don't have a lot of time to work on this, but if you can send a pr from the changes you made I can take look at it.
For sure! I just opened it: #494
Hi,
When working with DGRAM sockets, the
recvmmsg
andsendmmsg
syscalls are available to send multiple datagrams in a single syscall, potentially leading to increased performance (if the syscall rate is the bottleneck). I already have a draft available at https://github.com/Tuetuopay/socket2/tree/mmsg which is heavily inspired from the existingrecvmsg
/sendmsg
implementation, because I wanted to test it out.I'm opening the issue to discuss the API exposed, which is a bit simplified from the actual syscalls. The actual syscalls support scatter/gather buffers, just like
sendmsg
/recvmsg
, and are exposed bysocket2
; this however does not to keep the API in control. My questions are:_vectored
variants)MmsgHdr(Mut)
" is a valid option as it is done)_vectored
variants)I'm asking your opinion because the API is starting to look a lot like a full matrix of features with
recv(_multiple)?_from(_vectored)?
. Here is the added functions, with#[cfg]
removed for brievty:Thank you for your time!