QoS APIs are unfortunately not yet available natively via System.Net. We are looking at exposing these natively in a subsequent release; however, for now, you would have to pinvoke the unmanaged functions in qos2.h for your application. I'd be interested in your scenario so I can apply this learning to our API design for QoS in managed code in the future.
Hello,
I have a follow-up question on using the GQoS support from .NET for Windows XP.... Isn't QoS2.h applicable only for Windows Vista?
I am trying to evaluate my options on Windows XP wiith a .NET sockets application. Here is an option I tried and for some reason this does not work..
- Create a socket of type System.Net.Sockets.Socket
- Define the sockaddr, QOS_OBJECT_HDR, QOS_DESTADDR, WSABUF, FLOWSPEC, QOS structures from the various winsock/qos header files.
- Populate the QOS structure (very similar to my Winsock C++ application), serialize this to a byte array
- Call the Socket IOControl method with SetQos, serialized bytearray as parameters
The function call does not throw an exception, but returns 0 irrespective of the contents of the byte array. Sniffing the packet header indicates that the DSCP values have not been updated.
I would like to understand if this approach is correct and feasible. If not, what are my options here.
Thanks