4

.NET Core provides Sockets class which is an implementation of Berkely Sockets API.

It provides a method IOControl that allows setting low-level IO Control. It also has an enum where we can use IOControlCode.SetQos. What should be the value of other parameters of this method if we want to set DSCP of the IP header to CS1 (0x08) ?

The documentation says it passes the value to internal WinSockApi's WSAIoctl method. However its documentation is difficult to comprehend.

Jigar
  • 544
  • 1
  • 8
  • 28
  • It is [a DWORD option](https://learn.microsoft.com/en-us/windows/desktop/WinSock/ip-dscp-traffic-type), equivalent to uint in C#. Use BitConverter.GetBytes(8) to generate the optionInValue parameter value, null for the outValue. Do beware it silently ignored if the policy isn't turned on by the machine admin, https://learn.microsoft.com/en-us/windows-server/networking/technologies/qos/qos-policy-manage – Hans Passant May 08 '19 at 16:23
  • I understand the format, I am looking for detailed value or example. if that is in c++ I can translate to .net – Jigar May 08 '19 at 16:33
  • A detailed 8? If you want somebody to write and test the code for you then you need to say so in your question. – Hans Passant May 08 '19 at 16:41

0 Answers0