Newsgroups : Borland : borland.public.delphi.internet.winsock : 2006 Jan : TIdIOHandlerThrottle & TIdMappedPortTCP
| Subject: | TIdIOHandlerThrottle & TIdMappedPortTCP |
| Posted by: | "Koger" (ing..@mail.dk) |
| Date: | 24 Jan 2006 08:11:50 |
When using a TIdMappedPortTCP
why does neither of these methods work and what should I do instead?
1:
procedure TForm1.MappedPortOutboundConnect(AThread:
TIdMappedPortThread; AException: Exception);
var
IdIOHandlerThrottle: TIdIOHandlerThrottle;
begin
IdIOHandlerThrottle := TIdIOHandlerThrottle.Create(nil);
IdIOHandlerThrottle.ChainedHandler :=
AThread.OutboundClient.IOHandler;
AThread.OutboundClient.IOHandler := IdIOHandlerThrottle;
AThread.Data := IdIOHandlerThrottle; //Freed with AThread
end;
2:
procedure TForm1.MappedPortConnect(AThread: TIdMappedPortThread);
var
IdIOHandlerThrottle: TIdIOHandlerThrottle;
begin
IdIOHandlerThrottle := TIdIOHandlerThrottle.Create(nil);
IdIOHandlerThrottle.ChainedHandler :=
TIdIOHandlerSocket.Create(IdIOHandlerThrottle);
AThread.OutboundClient.IOHandler := IdIOHandlerThrottle;
AThread.Data := IdIOHandlerThrottle; //Freed with AThread
end;