Skip to content

Implement DSCP on udp connection#1868

Open
skoppe wants to merge 3 commits intovibe-d:masterfrom
skoppe:dscp
Open

Implement DSCP on udp connection#1868
skoppe wants to merge 3 commits intovibe-d:masterfrom
skoppe:dscp

Conversation

@skoppe
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Comment thread core/vibe/core/net.d Outdated
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Contributor Author

skoppe commented Jul 31, 2017

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

Comment thread core/vibe/core/net.d
*/
void setDSCP(ubyte codePoint);

/** Become member of IP multicast group
Copy link
Copy Markdown
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
Copy Markdown
Member

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

@s-ludwig
Copy link
Copy Markdown
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