Motivation
Around 20% of Firefox’s HTTP traffic today uses HTTP/3, which runs over QUIC, which in turn runs over UDP.
This translates to substantial UDP I/O activity.
Firefox uses NSPR for most of its network I/O.
When it comes to UDP I/O, NSPR only offers a limited set of dated APIs, most relevant here PR_SendTo and PR_RecvFrom, wrappers around POSIX’s sendto and recvfrom.
The N in NSPR stands for Netscape, giving you a hint of its age.