Board index » delphi » Need to create idTCPClient with proxy support dynamically.

Need to create idTCPClient with proxy support dynamically.

I need to create idTCPClient with proxy support dynamically in code, but I
am having difficult linking the IOHandlerSocket and SocksInfo objects.
Everything is being created dynamically.. Anyone know how to accomplish htis
with Indy 9.0.1 B

Thank in advance!

-Andrew

 

Re:Need to create idTCPClient with proxy support dynamically.


You already know that you have to place 3 componets on your form when you
are doing this in the RAD.

Lets assume that we already have one TIdSocksInfo component or variable of
this type with name SocksInfo, which properties are loadded.

Here the situation is similar:

Var
  IdTCP:TIdTCPClient;
  IdIO: TIdIOHandlerSocket;

begin
  IdTCP := TIdTCPClient.Create(nil);
  idTCP.IOHandler := TIdIOHandlerSocket.Create(nil);
  TIdIOHandlerSocket(idTCP.IOHandler).SocksInfo := SocksInfo;

  IdTcp.Connect;
end;

If you want to use separate TIdSocksInfo for every TCPConnection then you
have to do this:

  TIdIOHandlerSocket(idTCP.IOHandler).SocksInfo := TIdSocksInfo.Create(nil);
  TIdIOHandlerSocket(idTCP.IOHandler).SocksInfo.Assign(SocksInfo);

  IdTcp.Connect;
end;

--
------------------------------
Doychin Bondzhev - Team Indy
doyc...@dsoft-bg.com

Quote
"abaum" <ab...@abaum.com> wrote in message news:3ba14ff4$1_2@dnews...
> I need to create idTCPClient with proxy support dynamically in code, but I
> am having difficult linking the IOHandlerSocket and SocksInfo objects.
> Everything is being created dynamically.. Anyone know how to accomplish
htis
> with Indy 9.0.1 B

> Thank in advance!

> -Andrew

Other Threads