I was trying to manually connect. That is the only connect call in the pipe. I sent this code as a simplified version of what I actually have. I have the try..except and so forth. What is the "correct" way to do what I am trying to do here?
Matt -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Arno Garrels Sent: Wednesday, December 10, 2008 12:44 To: ICS support mailing Subject: Re: [twsocket] Error trying to connect to FTP Most likely you call Connect while a previous call to Connect is still in the pipe (some loop, TTimer etc.)? > Form1.FTPClient1.Connect(); Log(5, '{hms}: FTP: Connected > (hopefully)'); // <--- not actually connected at this point :( That's true and the great nature of non-blocking methods. Connect is asynchron, you should call it only in case a previously call to Connect returned in OnRequestDone. Also method Connect should always be enclosed in a try except block since it might raise an exception. -- Arno Garrels [TeamICS] http://www.overbyte.be/eng/overbyte/teamics.html Matt Minnis wrote: > Using Delphi 7, ICS FTPCli V6.03 > > On some machines I get the following error: 500 ESocketException: No > Error (#0 in Connect) > > Excerpt from my log: > 10:45:07: FTP: Ready to connect > ftp Request ConnectAsync Done. > ftp StatusCode = 500 > ftp LastResponse was : '500 ESocketException: No Error (#0 in > Connect)' ftp Error = 500 (500 ESocketException: No Error (#0 in > Connect)) > > This however works on other machines, ftp connects just fine and can > do all the transfers I need to. > > I can connect manually (cmd prompt ftp) to the site just fine. > I am trying to use Passive mode ftp, though I havent gotten that far > yet in the process so that shouldn't matter. > > There is no firewall or antivirus on this particular server. > > Code snippet: > > SetCurrentDir(ExtractFilePath(FileName)); > Form1.FTPClient1.Password := FTPPassword; > Form1.FTPClient1.UserName := FTPUser; > Form1.FTPClient1.LocalFileName := ExtractFileName(FileName); > Form1.FTPClient1.HostFileName := ExtractFileName(FileName); > Form1.FTPClient1.HostDirName := '/'; > //If not connected then try connecting > Log(5, '{hms}: FTP: Ready to connect'); > if (Form1.FTPClient1.Connected = false) then > Form1.FTPClient1.Connect(); Log(5, '{hms}: FTP: Connected > (hopefully)'); // <--- not actually connected at this point :( > > Using the ICS Logger set as: ICSLogger1.LogOptions := > [loDestEvent,loDestFile,loDestOutDebug,loAddStamp,loWsockErr,loWsockInfo,loW > sockDump]; > I get very little: > 10:45:07:176 TWSocket will connect to xxx.xxx.xxx.xxx:21 > 10:45:07:238 00A4DA90 TriggerDataSent 1276 > > Anyone know the cause of this? > What can I do to troubleshoot this? > > Thanks! > Matt -- 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