You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to build an example io_uring echo udp server here. Basically since recv_from is not available, I need to use recvmsg and somehow retrieve the source address to respond.
My first question is why this work:
letmut msg_hdr: libc::msghdr = unsafe{ std::mem::zeroed()};// I copied this from tokio/io-uring test code, I don't know why it works// https://github.com/tokio-rs/io-uring/blob/master/io-uring-test/src/tests/net.rs
msg_hdr.msg_namelen = 16;
If I set msg_namelen to anything but 0 and 16 then I get parsing errors. If I set to 0 the msghdr is always empty (excpet the payload size). If I set to 16 then I get some data like:
But I don't know how to interpret this. How do I use this data to create a file descriptor for SendMsg?
Should I maybe set somehow the IP_PKTINFO flag?
The text was updated successfully, but these errors were encountered:
I'm trying to build an example
io_uring
echo udp server here. Basically sincerecv_from
is not available, I need to userecvmsg
and somehow retrieve the source address to respond.My first question is why this work:
If I set
msg_namelen
to anything but 0 and 16 then I get parsing errors. If I set to 0 themsghdr
is always empty (excpet the payload size). If I set to 16 then I get some data like:But I don't know how to interpret this. How do I use this data to create a file descriptor for
SendMsg
?Should I maybe set somehow the
IP_PKTINFO
flag?The text was updated successfully, but these errors were encountered: