Add support for ancillary data receiving
yuguorui opened this issue · comments
There is currently no way to accept ancillary (control) data from the OS.
In the Unix world, it can be achieved through recvmsg, and in the Windows world, it can be achieved through WSARecvMsg.
One of the typical use cases of ancillary (control) data is IP_PKTINFO, which has been implemented by most mainstream OS to distinguish the IP address and NIC receiving the data packet.
[1] Linux: https://man7.org/linux/man-pages/man7/ip.7.html#:~:text=control%20message%20type.-,IP_PKTINFO,-(since%20Linux%202.2
[2] Windows: https://learn.microsoft.com/en-us/windows/win32/winsock/ip-pktinfo?redirectedfrom=MSDN
Related Information: tokio-rs/mio#1679
RFC version of implementation: #446
Sure, thanks for your work!