Re: Setting the Type-Of-Service/TOS Byte within an IP frame in UDP.

Giganews Newsgroups
Subject: Re: Setting the Type-Of-Service/TOS Byte within an IP frame in UDP.
Posted by:  Remy Lebeau (TeamB) (no.spam@no.spam.com)
Date: Tue, 13 Dec 2005

"Tim Hyde" <timhy…@c21technology.com> wrote in message
news:5B8D758870E5E240timhy…@c21technology.com...

> I want to set the TOS setting of UDP packets that I am sending out.
> There is no option in the incomplete version of SetSockOpt within
> Tidsockethandle

There is nothing incomplete about TIdSocketHandle.SetSockOpt().

> the flag I should be using IP_TOS is not supported and an exception is
thrown.

SetSockOpt() passes the flags as-is to the socket API directly.  If an
exception is thrown, then the socket API itself is reporting an error, which
means that the the socket API does not support what you are trying to do.

> No problem I thought, I'll just set it using the WinSock funtion and
> everything will be okay.  Well this works fine, I can set it, and I can
> read it back, but does this setting show up in the actual UDP packet
> I send out - No.

Like I said, the socket API is reporting that it does not support what you
want.

> Skt.Binding.SetSockOpt(IPPROTO_IP,IP_TOS,@tos,1);

Have a look at the following article:

    Setsockopt Is Unable to Mark the Internet Protocol Type of Service Bits
in Internet Protocol Packet Header
  http://support.microsoft.com/default.aspx?scid=kb;en-us;Q248611

> This throws the exception too.

As it should be when the socket API setsockopt() reports an error that Indy
then converts into an exception.

Gambit

Replies

In response to

Setting the Type-Of-Service/TOS Byte within an IP frame in UDP. posted by Tim Hyde on Tue, 13 Dec 2005