2 comments

[ 5.7 ms ] story [ 42.5 ms ] thread
I work on Bun. Happy to answer any questions.

One of the things I’m happy about in our UDP sockets implementation is socket#sendMany. Internally, it uses sendmmsg on Linux and the undocumented sendmsg_x API on macOS which let you send multiple datagrams to multiple addresses in a single system call. Internally we do this automatically when reading messages (recvmmsg / recvmsg_x)