Re: [twsocket] Ftp component not ready

2012-10-21 Thread Fran├žois Piette
 I'm running into a Ftp component not ready error. 
 What is the proper way to check for the component being ready in c++?

Use the OnRequestDone event.

-- 
francois.pie...@overbyte.be
Embarcadero MVP
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


Re: [twsocket] Ftp component not ready

2012-10-21 Thread Walter Bohlin

Francois,

I am use the OnRequestDone event as I always have, but this year I need 
to pull 10 files from 4 directories, and everything seems to have fallen 
apart. Always suspecting that I did something stupid, I rewrote the pull 
application as a standalone, and still get an occasional FTP component 
is not ready error.


Here is my code.. do you see any obvious errors?

void __fastcall TForm1::FtpAp1RequestDone(TObject *Sender, TFtpRequest 
RqType,

  WORD ErrCode)
{
int x;
if(Form1-FtpAp1-Connected==0  ftp_step15)
{
ftp_step=0;
Form1-FtpAp1-ConnectAsync();
return;
}
if(ftp_step15)
{
return;
}
ftp_step++;
switch(ftp_step)
{
case 1: Form1-FtpAp1-HostDirName=/NJ/dbready;
Form1-FtpAp1-CwdAsync();
break;
case 2: Form1-FtpAp1-HostFileName=NJ_Race.txt;
Form1-FtpAp1-LocalFileName=c:\\WNET\\NJ_Race.txt;
Form1-FtpAp1-GetAsync();
break;
case 3: Form1-FtpAp1-HostFileName=NJ_Candidate.txt;
Form1-FtpAp1-LocalFileName=c:\\WNET\\NJ_Candidate.txt;
Form1-FtpAp1-GetAsync();
break;
case 4: Form1-FtpAp1-HostFileName=NJ_Results.txt;
Form1-FtpAp1-LocalFileName=c:\\WNET\\NJ_Results.txt;
Form1-FtpAp1-GetAsync();
break;
case 5: Form1-FtpAp1-HostDirName=/ct/dbready;
Form1-FtpAp1-CwdAsync();
break;
case 6: Form1-FtpAp1-HostFileName=CT_Race.txt;
Form1-FtpAp1-LocalFileName=c:\\WNET\\CT_Race.txt;
Form1-FtpAp1-GetAsync();
break;
case 7: Form1-FtpAp1-HostFileName=CT_Candidate.txt;
Form1-FtpAp1-LocalFileName=c:\\WNET\\CT_Candidate.txt;
Form1-FtpAp1-GetAsync();
break;
case 8: Form1-FtpAp1-HostFileName=CT_Results.txt;
Form1-FtpAp1-LocalFileName=c:\\WNET\\CT_Results.txt;
Form1-FtpAp1-GetAsync();
break;
case 9: Form1-FtpAp1-HostDirName=/NY/dbready;
ftp_req_done==0;
Form1-FtpAp1-CwdAsync();
break;
case 10: Form1-FtpAp1-HostFileName=NY_Race.txt;
Form1-FtpAp1-LocalFileName=c:\\WNET\\NY_Race.txt;
Form1-FtpAp1-GetAsync();
break;
case 11: Form1-FtpAp1-HostFileName=NY_Candidate.txt;
Form1-FtpAp1-LocalFileName=c:\\WNET\\NY_Candidate.txt;
Form1-FtpAp1-GetAsync();
break;
case 12: Form1-FtpAp1-HostFileName=NY_Results.txt;
Form1-FtpAp1-LocalFileName=c:\\WNET\\NY_Results.txt;
Form1-FtpAp1-GetAsync();
break;
case 13:Form1-FtpAp1-HostDirName=/Pres_Reports/dbready;
ftp_req_done==0;
Form1-FtpAp1-CwdAsync();
break;
case 14:Form1-FtpAp1-HostFileName=pres_electoral.txt;
Form1-FtpAp1-LocalFileName=c:\\WNET\\pres_electoral.txt;
Form1-FtpAp1-GetAsync();
break;
case 15:Form1-FtpAp1-QuitAsync();
secs_since=0;
Form1-SecsSince-Color=clGreen;
Form1-SecsSince-Font-Color=clWhite;
Form1-UDPsocket-SendLine(APUpdate\r\n);
break;
}
}




On 10/21/2012 5:25 AM, Fran├žois Piette wrote:

I'm running into a Ftp component not ready error.
What is the proper way to check for the component being ready in c++?

Use the OnRequestDone event.




--
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


Re: [twsocket] Ftp component not ready

2012-10-21 Thread Walter Bohlin

Francois,

I apologize. It appears my problem was due to a faulty router. Thanks 
for your help!


Walter


--
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


Re: [twsocket] FTP component not ready

2007-08-11 Thread Fastream Technologies
You should use OnRequestDone.

Regards,

SZ

- Original Message - 
From: Steve Loft [EMAIL PROTECTED]
To: twsocket@elists.org
Sent: Saturday, August 11, 2007 3:45 PM
Subject: [twsocket] FTP component not ready


I am trying to get the FTP component (V6 Beta) to connect and then 
 upload a file. In the handler for the OnSessionConnected event, I 
 attempt to do a 'Put', but I get an FTP component not ready exception. 
 I thought I had done this successfully with previous versions of ICS. 
 What am I doing wrong, please?
 
 Steve
 -- 
 To unsubscribe or change your settings for TWSocket mailing list
 please goto http://www.elists.org/mailman/listinfo/twsocket
 Visit our website at http://www.overbyte.be
-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


Re: [twsocket] FTP component not ready

2007-08-11 Thread Steve Loft
Fastream Technologies wrote:
 You should use OnRequestDone.

   

Ah yes, that works - many thanks!

Steve
-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be