[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: FTP Try again later messge



Scott,
Xfer could be a procedure that puts a file and returns 0 for success, -1 for failure.
Apologies for my implications, I meant to confirm I do not 'handle a message', rather I
'handle connection/no connection'
Thanks for the heads-up on FTP values; and changing FTPAPI code is beyond me.


-----Original Message-----
From: ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx [mailto:ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of Scott Klement
Sent: Wednesday, September 10, 2014 3:50 PM
To: HTTPAPI and FTPAPI Projects
Subject: Re: FTP Try again later messge

I don't understand this code.  If ftp=0, then ftp=Xfer?   What on earth 
does that do?

You are making the assumption that FTP will always be zero if successful.  That's not a safe assumption -- it will be zero OR HIGHER, if successful, so it could be 1, 2, 3 etc.  It depends on what else is using TCP/IP and other Unix-type APIs in the job.

Also, you should nto change the value returned from FTP_Conn to 
something else.   That will wreak havoc.   Both FTPAPI and the operating 
system (internally) are using the number returned from FTP_Conn() to track which network connection has been made, and all of it's attributes.  You can't substitute your own number, here... you have to use the one that we're using to track things.

-SK

On 9/10/2014 4:38 PM, Gary Thompson wrote:
> Scott,
> The 'Try Again' message seemed to me to be my 'key'.
> 000.000.000.000 was intentional because I don't want to expose that server.
> Now, my (corrected) approach:
> ftp = FTP_Conn( 'thehost': userId: password: FTP_PORT: 30 ); If ftp = 
> 0;
>     ftp = Xfer;
> Else
>    ftp = ReSched;
> Endif;
>
> Thank you!
>
>
>
> -----Original Message-----
> From: ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx 
> [mailto:ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of Scott 
> Klement
> Sent: Wednesday, September 10, 2014 2:59 PM
> To: HTTPAPI and FTPAPI Projects
> Subject: Re: FTP Try again later messge
>
>
> This is not an error message that FTPAPI returns?!
>
> This is a pretty weird message.  "Host X at address."?  What kind of
> grammar is that?   And 000.000.000.000 is not a valid IP address.. in
> fact, it's not even formatted correctly, you can't have leading zeros on an IP address...
>
> If you just want to know if a connection has failed, just do this:
>
>       ftp = FTP_Conn( 'thehost': userId: password: FTP_PORT: 30 );
>       if ftp = -1;
>          // connection failed.
>       endif;
>
> That's a 30 second timeout..  change the 30 to another number if you want a different timeout.
>
>
>
> On 9/10/2014 3:02 PM, Gary Thompson wrote:
>>      Just installed FTPAPI with hopes to catch msg from FTP host:
>>      `Cannot connect to host 000.000.000.000 at address . Try again later.'
>>
>>      Goal is to re-schedule the transfer for a later time.
>>
>>      All comments welcome by this FTP novice
>>
> ----------------------------------------------------------------------
> - This is the FTPAPI mailing list.  To unsubscribe, please go to:
> http://www.scottklement.com/mailman/listinfo/ftpapi
> ----------------------------------------------------------------------
> -
> ----------------------------------------------------------------------
> - This is the FTPAPI mailing list.  To unsubscribe, please go to:
> http://www.scottklement.com/mailman/listinfo/ftpapi
> ----------------------------------------------------------------------
> -
>

-----------------------------------------------------------------------
This is the FTPAPI mailing list.  To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------
-----------------------------------------------------------------------
This is the FTPAPI mailing list.  To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------