Hi, just wondering how to deal with this scenario in which 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:
-------------------------------------------------
int tos = 0x60; // CS3 just for audio packets.
uv_os_fd_t fd;

// Get the real file descriptor from our libuv UDP handle:
uv_fileno((const uv_handle_t*)udpHandle, &fd);

// Set ToS/DSCP:
if (setsockopt(sock, IPPROTO_IP, IP_TOS,  &tos, sizeof(tos)) < 0) {
    fprintf(stderr,"Error setting TOS: %s\n", strerror(errno));
}

// Try to send the packet synchronously:
uv_udp_try_send(....);

// It fails, so send it asynchronously:
uv_udp_send(....);
--------------------------------------------------

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 use uv_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 to setsockopt() for a different packet to be
sent.

Just wondering if there is a way to tell libuv "please send this
socket option for sending this data no matter when such a data is
actually sent.

Thanks a lot.


-- 
Iñaki Baz Castillo
<[email protected]>

-- 
You received this message because you are subscribed to the Google Groups 
"libuv" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/libuv/CALiegfmopAxJ1q-dPnB0zOk%3Dx0q_78U3VVpqZ%2BnDaNq0xoAmrw%40mail.gmail.com.

Reply via email to