-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
Extending the uv_udp_send_t to hold a "before_send" callback #2536
Comments
I think the right way to do this is to use sendmsg in the ancilliary data |
Ok, so then |
Heh, well, that's easier said than done, of course. For one, windows doesn't have |
Just curious, why is that? Looking at the documentation it seems it could be used to send control data using the |
Oops, you're totally right. It doesn't appear to support IP_TOS, but I guess that's anoher story. |
|
Sorry, you're right. It says: 'Do not use.' |
So, what would be the way to go?
? |
Option 1) would have higher chances of success because you could create |
Makes sense. I'll work in a PR in the next weeks. |
Excuse me, does not 1) break the current API (not ABI)? |
No, if you create new functions. |
@saghul, a couple of questions:
Thanks! |
Yeah, we could indeed use the reserved fields for that. |
No, we can't. For this feature, libuv should call a before_send cb placed into that ex by the app, so it should be a dedicated slot in the req struct. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Thanks, bot. |
I am wondering about this issue. Is it closed because of lost of interest or just lack of time? I guess the second. AFAIK home WIFI routers implemented WMM and it is by default on, and it adds priority to media traffic if it is marked |
I need to set UDP or TCP socket options (via
setsockopt()
) per sent data, this is, I may need to set different socket options for each new UDP datagram or TCP data to be sent.For instance, this is my use case:
I need to set different DSCP values to UDP packets (actually IP packets) sent on
the same
uv_udp_t
handle. For instance, I send RTP audio and video packets and need to set a specific DSCP/ToS value just for audio packets:pseudo-code:
This is: before sending each packet I need to call
setsockopt()
with the corresponding DSCP/ToS value for that packet. However, since I may need to useuv_udp_send()
it may happen that, when libuv finally sends the RTP audio packet, the socket DSCP setting may has been modified again due to a new call tosetsockopt()
for a different packet to be sent.As suggested by Santiago in the mailing list, the
uv_udp_send_t
struct (and so theuv_write_t
struct) may hold abefore_send
callback so that would give the app a chance to runsetsockopt()
.Does it seem feasible?
The text was updated successfully, but these errors were encountered: