node-ftp icon indicating copy to clipboard operation
node-ftp copied to clipboard

connecting prevents process from exiting

Open suddjian opened this issue 8 years ago • 1 comments

In my use case, I make a client just to stream one file from a server, and then I close the connection. Trouble is there's a _keepalive timer that appears to be recurring, so when I call .destroy() the keepalive is still going, preventing the process from exiting (without a force quit, which I want to avoid)

suddjian avatar Mar 23 '17 17:03 suddjian

I think this is because I'm calling client.destroy() in the stream.on('close') handler. If I call client.destroy() in the next tick, it works. There is probably a conflicting close handler somewhere that overwrites my destroy() call

suddjian avatar Mar 23 '17 17:03 suddjian