I just wanted to report back that I got everything working now. The simple
problem was that I tried to use TWSocket.Handle as you suggested.
But I have to use TWSocket.HSocket instead.

Thanks for your feedback.
I'm always happy to know how user solved problems.
Not enough people take the time to send feeback.

--
[email protected]
The author of the freeware multi-tier middleware MidWare
The author of the freeware Internet Component Suite (ICS)
http://www.overbyte.be

----- Original Message ----- From: "Stefan Paege" <[email protected]>
To: "'ICS support mailing'" <[email protected]>
Sent: Monday, October 25, 2010 10:24 AM
Subject: Re: [twsocket] Quality of Service?


Francois,

I just wanted to report back that I got everything working now. The simple
problem was that I tried to use TWSocket.Handle as you suggested. But I have
to use TWSocket.HSocket instead.

Regarding IP_TOS:
You should not use it on Vista and later. And you don't need to as there is
a nice thing called "Policy based QoS". With that you don't even code QoS
into your app. You just create a Windows policy. Neat.

On XP you can use APIs like GQoS or TC. But TC needs admin rights which
makes it unuseable for me. And GQoS I have not found any good documentation
on how to use it. On the other hand I have found explicit instructions on
MSDN on how to use IP_TOS on XP systems (Create a registry key
HKLM/SYSTEM/CurrentControlSet/Services/Tcpip/Parameters/DusableUserTOSSettin
g=0).
So I will use it that way.

Thanks again for your efforts.



 Stefan Paege


elektronik-labor CARLS GmbH & Co. KG
Bergweg 6
48485 Neuenkirchen
GERMANY
Telefon: +49 (0) 5973 / 9497-23
Telefax: +49 (0) 5973 / 9497-19
E-Mail: [email protected]
Internet: www.el-carls.de

Kommanditgesellschaft: Sitz Neuenkirchen, Registergericht Steinfurt HRA 3310

Persönlich haftende Gesellschafterin: elektronik-labor CARLS,
Beteiligungsgesellschaft mbH, Sitz Neuenkirchen, Registergericht Steinfurt
HRB 4175

Geschäftsführer: Irmgard Carls, Joachim Schulte, Helmut Schiffelholz

-----Ursprüngliche Nachricht-----
Von: [email protected] [mailto:[email protected]]
Im Auftrag von Francois PIETTE
Gesendet: Montag, 11. Oktober 2010 14:32
An: ICS support mailing
Betreff: Re: [twsocket] Quality of Service?

You should call WSAGetLastError to know why the call fails.
Also you must be sure to call your function at a time that the Handle
property is initialized.

By the way, in the description for IP_TOS, I read the following: "Do
not
use. Type of Service (TOS) settings should only be set using the
Quality of
Service API. See Differentiated Services in the Quality of Service
section
of the Platform SDK for more information."
http://msdn.microsoft.com/en-us/library/ms738586(VS.85).aspx

--
[email protected]
The author of the freeware multi-tier middleware MidWare
The author of the freeware Internet Component Suite (ICS)
http://www.overbyte.be

----- Original Message -----
From: "Stefan Paege" <[email protected]>
To: "'ICS support mailing'" <[email protected]>
Sent: Monday, October 11, 2010 1:22 PM
Subject: Re: [twsocket] Quality of Service?


Francois

> In a TWSocket you have access to the low level socket ahndle using
> TWSocket
> Handle property. You can issue winsock API function call using that
> handle.

So the following code should work!?
WSocket_SetSockOpt does not throw an exception but returns -1.
What kind of error is this?
Any errors I would expect are in the 100xx or 110xx range.

procedure SetToS(aTWSocket: TWSocket; aToS: Byte);
var
  Len: Integer;
  Result: Integer;
begin
  try
    Len := 1;
    Result := WSocket_SetSockOpt(aTWSocket.Handle, IPPROTO_IP, IP_TOS,
@aToS, Len);
    if Result = 0 then
      Log('ToS set')
    else
      Log('ToS not set: Errorcode ' + IntToStr(Result));
  except
    on E: Exception do
      Log('ToS not set: ' + E.Message);
  end;
end;



  Stefan Paege


elektronik-labor CARLS GmbH & Co. KG
Bergweg 6
48485 Neuenkirchen
GERMANY
Telefon: +49 (0) 5973 / 9497-23
Telefax: +49 (0) 5973 / 9497-19
E-Mail: [email protected]
Internet: www.el-carls.de

Kommanditgesellschaft: Sitz Neuenkirchen, Registergericht Steinfurt HRA
3310

Persönlich haftende Gesellschafterin: elektronik-labor CARLS,
Beteiligungsgesellschaft mbH, Sitz Neuenkirchen, Registergericht
Steinfurt
HRB 4175

Geschäftsführer: Irmgard Carls, Joachim Schulte, Helmut Schiffelholz



--
To unsubscribe or change your settings for TWSocket mailing list
please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be

--
To unsubscribe or change your settings for TWSocket mailing list
please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


--
To unsubscribe or change your settings for TWSocket mailing list
please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be
--
To unsubscribe or change your settings for TWSocket mailing list
please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be

Reply via email to