Skip to content
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

Implement DSCP on udp connection #1868

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Implement DSCP on udp connection #1868

wants to merge 3 commits into from

Conversation

skoppe
Copy link
Contributor

@skoppe skoppe commented Jul 21, 2017

Simple wrapper around setsockopt call to implement Differentiated Services Code Point. (see: https://en.wikipedia.org/wiki/Differentiated_services)

static const IP_TOS = 3;
} else version(Linux)
{
import std.c.linux.socket : IP_ADD_MEMBERSHIP, IP_MULTICAST_LOOP;
Copy link
Member

@wilzbach wilzbach Jul 22, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI: #1863 (std.c is deprecated, but there's no replacement for these constants)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool! Looking forward to it :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this is unlikely to change on the protocol level, doesn't it make sense to use ubyte here?

Copy link
Contributor Author

@skoppe skoppe Jul 23, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I suppose so. Using uint didn't feel right to me either. But neither did anything else. Will change it.

@skoppe
Copy link
Contributor Author

skoppe commented Jul 31, 2017

btw. I am also preparing a PR for event-core and vibe-core

*/
void setDSCP(ubyte codePoint);

/** Become member of IP multicast group
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A trailing space slipped in here.

@s-ludwig
Copy link
Member

The signatures in the win32 and libasync drivers still need to be updated to use ubyte. Otherwise LGTM.

@s-ludwig
Copy link
Member

btw. I am also preparing a PR for event-core and vibe-core

Thanks, that would be great!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants