.Net Sockets and QOS

  • Thread starter Fade BS via DotNetMonster.com
  • Start date
F

Fade BS via DotNetMonster.com

i have been trying to implement QualityOfServive capabilities onto a c
client-Server project i have been working on, and i have reached a dead end.
it seems that in order to implement QOS capabilities on a socket it has to
be created using the WSASocket method- BUT - when doing so i can't see a
way to handle the created socket, using the .Net Socket class.

now, i know there is the IOControl method for the socket that should be the
equivalent of the WSAIoctl but if so, how do i trasform the QOS structure
into a byte array (required for the inValue) ?

The question is, either, how do i implement QOS the .Net way, OR how do i
control a Socket created by WSASocket through the .Net (which i don't know
if possible), and finaly the ultimate question, how do i implement QOS
using .Net?
 
N

Nicholas Paldino [.NET/C# MVP]

Fade,

Can you show the definition of the QOS structure? If it doesn't have
any references (pointers) to anything outside of itself, then you can use
the marshaling infrastructure to perform the conversion, or unsafe code.

With marshaling, you would have to define the structure, and then
allocate unmanaged memory for the structure. Then, you would call the
static StructureToPtr method on the Marshal class to marshal the managed
structure to unmanaged memory.

From there, you can call the static Copy method on the Marshal class to
copy the unmanaged memory to a byte array.

With unsafe code, you can define the structure, and then cast it to a
byte array (assuming you have the array declared), and then use that.

Hope this helps.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top