Implement DSCP on udp connection#1868
Conversation
| static const IP_TOS = 3; | ||
| } else version(Linux) | ||
| { | ||
| import std.c.linux.socket : IP_ADD_MEMBERSHIP, IP_MULTICAST_LOOP; |
There was a problem hiding this comment.
FYI: #1863 (std.c is deprecated, but there's no replacement for these constants)
There was a problem hiding this comment.
I came to the same conclusions. I have a unfinished PR laying around adding those and more to druntime. I just need to add all the different OSes.
There was a problem hiding this comment.
Cool! Looking forward to it :)
There was a problem hiding this comment.
Bit stuck on the issue.
| Used for Quality of Service. 6bit number, higher is more priority. | ||
| see https://www.iana.org/assignments/dscp-registry/dscp-registry.xhtml | ||
| */ | ||
| void setDSCP(uint codePoint); |
There was a problem hiding this comment.
Since this is unlikely to change on the protocol level, doesn't it make sense to use ubyte here?
There was a problem hiding this comment.
Yeah, I suppose so. Using uint didn't feel right to me either. But neither did anything else. Will change it.
|
btw. I am also preparing a PR for event-core and vibe-core |
| */ | ||
| void setDSCP(ubyte codePoint); | ||
|
|
||
| /** Become member of IP multicast group |
There was a problem hiding this comment.
A trailing space slipped in here.
|
The signatures in the win32 and libasync drivers still need to be updated to use |
Thanks, that would be great! |
Simple wrapper around setsockopt call to implement Differentiated Services Code Point. (see: https://en.wikipedia.org/wiki/Differentiated_services)