-
Notifications
You must be signed in to change notification settings - Fork 189
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
luv_new_udp: Add support for UV_UDP_RECVMMSG #487
Conversation
Some part of the test failures are from libuv bugs with |
Valgrind/ASAN test failures might also be a libuv upstream issue: libuv/libuv#2818 |
More relevant info regarding
|
40d3322
to
81eebcf
Compare
This makes it so that Lua doesn't get irrelevant callbacks when recv_cb is called by Libuv only to free the buffer used by recvmmsg. See libuv/libuv#2836 for more context
81eebcf
to
407f9c3
Compare
Ok, this is ready for review. I decided against enabling Lines 31 to 37 in 407f9c3
(in some very basic testing, I noticed that using recvmmsg has some overhead so I figured always enabling it is probably not the correct decision; I don't know much about its use case, though, so if anyone has more experience let me know what you think) All the rest is handled automatically, though, and there's no difference from the Lua side (the same number of Lua recv callbacks are called for a udp handle that is using recvmmsg as one that isn't). |
See the added comment for my thought process here:
luv/src/udp.c
Lines 48 to 57 in 43fb118
Submitting this as a draft because there's still some more things to be figured out:
recvmmsg
depends on the buffer size, which we don't give Lua control of (we use thesuggested_size
from uv_alloc_cb). Maybe turning onUV_UDP_RECVMMSG
only makes sense if we also allow changing the size of the recv buffer.luv_new_udp
is a little bit strange now, I think we might want to allow it to be passed as a table and have different fields for address family and recvmmsg. This comment is relevant: Some minor API inconsistencies #399 (comment)