Mega Code Archive

 
Categories / Delphi / Ide Indy
 

Indyservers

Title: indyservers Question: Hi,I have a problem when I work with indy servers.Actually I have implemented an application which works as a gateway. Answer: procedure TForm1.IdTCPServer1Execute(AThread: TIdPeerThread); var rcv : String; FtcpClient : TIdTCPClient; begin with AThread.Connection do begin rcv := ReadLn(); FtcpClient := TIdTCPClient.Create(nil); FtcpClient.Port := 6000; FtcpClient.Host := '127.0.0.1'; FtcpClient.Connect(1000); FtcpClient.WriteLn(rcv); rcv := FtcpClient.ReadLn(); FtcpClient.Free; WriteLn(rcv); end; end; This application listens on a specific port and writes the request on another port for another application to get the answer and finally writes the answer for the first one. These application work but when the number of raised thread gets high a time out error would be appeard. what should I do? I really do not know the soloution.If someone knows please help me.Thanks