Gossamer Forum
Home : General : Perl Programming :

using stor/retr between threads

Quote Reply
using stor/retr between threads
I have a stor() that starts in a subroutine, and subsequently launch a seperate thread using the "threads" module to handle the upload to avoid locking my Tk application and allow for an abor() command to be sent. my problem with this is because of that, I can't send the close() command for the transfer (dong so locks up the application when the thread finishes uploading data). I thought calling the close in the thread would work, but it threw up an error because sharing globs isn't supported.

anyway, my question: is it is safe to not call close()?

I haven't noticed any problems after transfer (files retain exact size, files execute properly), aside that I obviosly don't get a proper "226 Transfer complete." response. I could always fake the response in my log window I suppose.

Philip
------------------
Limecat is not pleased.

Last edited by:

fuzzy logic: Sep 6, 2003, 11:03 PM
Quote Reply
Re: [fuzzy logic] using stor/retr between threads In reply to
thanks anyway folks. I managed to work out what I needed to do. All that was required was slightly rework my transfer cancel routine, untie() STDERR while my FTP thread was running. in the thread, I opened STDERR for writing to a log file, which I was then able to simulatenously able to read from in the main loop. since that worked, I can now properly close the transfer request. hm.. actually it seemed like an awful lot of work just to get that official "226" message in there. Mad

the solution I came up with is more or less what I posted in Andy's thread here

Philip
------------------
Limecat is not pleased.