Handle Net::FTP connection timeout

Hi Brian!

I don't know about Net::FTP, but as a suggestion: what if you spawned
a separate thread right before you open the connection and that thread
does a: sleep(30) then checks the FTP connection and forces it to
close if need be.

Of course, if there isn't a way to check the connection separately,
that may not work.

The flip-side may make more sense, while I think of it: spawn a thread
to do the FTP connection and have your main thread sleep 30 seconds.
Then have the main thread check the status and if need be kill the FTP
connection or the child thread altogether.

Just a thought. :slight_smile:

-Danimal

The flip-side may make more sense, while I think of it: spawn a thread
to do the FTP connection and have your main thread sleep 30 seconds.
Then have the main thread check the status and if need be kill the FTP
connection or the child thread altogether.

which is basically what http://www.ruby-doc.org/stdlib/libdoc/timeout/rdoc/index.html
does

Fred

Frederick Cheung wrote: