On Jun 8, 2006, at 7:37 PM, Jochem van Dieten wrote:

> |Rens| > 0 wrote:
>>
>> The FTP connection will be cached, so that I don't have to suffer  
>> from
>> the overhead of the connection process. I need to generate and FTP
>> almost 20.000 files in one request. The thing is that the remote FTP
>> deamon will disconnect me after 300 seconds (indicated by a '[pid  
>> 3812]
>> [netmasters2] FTP response: Client "192.168.5.15", "421 Timeout."').
>
> Will it disconnect the data channel, the command channel or both?

According to RFC 959:

421 Service not available, closing control connection.
     This may be a reply to any command if the service knows it
     must shut down.

It seems to be the control/command connection.

>> 1. Try to upload the file using the existing connection
>> 2. If [1] fails, then close
>
> That is based on the presumption that you can close the existing
> connection. I don't know anything about the implementation
> details of FTP in CF, but on the TCP layer just closing the
> connection can already take up to 4 minutes.

Yes, sorry .. in my dispair to find a solution, I have tried just  
about all 'sane' solutions to my problems. At first, I just tried to:

open; if that failed, I tried to (re)open

When that code construct failed, I tried the above version, because I  
then thought: "well, let's close this connection explicitly, so that  
I can at least reopen it when it has been closed".

>> and (re)open the existing connection
>
> If closing fails, you can't reopen it.

Not true.

If something *is* closed, and you *try* to close it, you can open it  
after your (failed) attempt to close it.

That's why I thought of it.

>> 3. Try to upload it again
>>
>> In pseudo-code:
>>
>> <cfftp action="open" />
>>
>> <cfif shitHappened>
>>    <cfftp action="close" />
>>    <cfftp action="open" />
>> </cfif>
>
>
>> I have been Google'ing for days now, but I can't figure out how to
>> reopen a connection that has been timed out. If anyone could tell  
>> me how
>> to do this, I would be very, very greatful ..
>
> Start a brand new connection whenever you are disconnected and
> use that until you are disconnected again.

Yup, that's what I'm trying now .. thing is, it takes a few rewrites  
to a 3 dimensional struct (array's won't work since there is a  
difference between copy-by-reference and copy-by-value in CF for the  
two distinct datatypes) and it's all placed in a 100k file. It would  
be useless to tell you why and how, so I won't tell you all the nice  
details about it ;)

I'll let you guys know if I got it to work :)

Rens

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:242984
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to