 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
York Guest
|
Posted: Thu May 10, 2007 7:03 pm Post subject: Need help with IdIOHandleThrottle on server side |
|
|
Hello
I am trying to implement the following posted by Remy a few months ago
Throttle := TIdIOHandlerThrottle.Create(AThread.Connection);
Throttle.BytesPerSec := 1024;
{ TIdTCPConnection owns the initial TIdIOHandler, so reassign the
ownership so the IOHandler is not freed when changing the
property...}
Throttle.InsertComponent(AThread.Connection.IOHandler);
Throttle.ChainedHandler := AThread.Connection.IOHandler;
TIdTCPConnectionAccess(AThread.Connection).FFreeIOHandlerOnDisconnect :=
False;
AThread.Connection.IOHandler := Throttle;
After the code above when I try to access AThread.Connection.Socket it
returns nil
Could you help me please to throttle the connection on the server side
Thank you |
|
| Back to top |
|
 |
Remy Lebeau (TeamB) Guest
|
Posted: Thu May 10, 2007 11:22 pm Post subject: Re: Need help with IdIOHandleThrottle on server side |
|
|
"York" <no> wrote in message news:46432647$1 (AT) newsgroups (DOT) borland.com...
| Quote: | After the code above when I try to access AThread.Connection.Socket
it returns nil
|
As it should be, because the Connection.IOHandler is no longer set to
a TIdIOHandlerSocket-based object anymore.
So what exactly are you having a problem with? If all you are trying
to do is access the original IOHandler, then you can reach it through
the Throttle's ChainedHandler property, ie:
var
Socket: TIdIOHandlerSocket;
begin
//...
Socket :=
TIdIOHandlerSocket(TIdIOHandlerThrottle(AThread.Connection.IOHandler).
ChainedHandler);
// use Socket as needed ...
//...
end;
Gambit |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|