'Disable ftp connection timeout using ftp npm package in nodejs

I am using npm ftp and getting the timeout after 10 minutes and i have gone through the ftp package documentation and there is no timeout disable option. If we are going to use basic-ftp npm then there is timeout disable option is there but i haven't found anything in ftp. Yes, there is keepalive params is there in the ftp but i want to keep the connection for always.Is there anything that i am missing while keeping the ftp connection.

` throw er; // Unhandled 'error' event ^

Error: No-transfer-time exceeded. Closing control connection.`



Solution 1:[1]

https://github.com/mscdex/node-ftp

Under Methods:

Find connect:

You'd use these within your config object when firing off connect. Just add these additional params in and set the MS for your requirements.

connTimeout - integer - How long (in milliseconds) to wait for the control connection to be established. Default: 10000

pasvTimeout - integer - How long (in milliseconds) to wait for a PASV data connection to be established. Default: 10000

keepalive - integer - How often (in milliseconds) to send a 'dummy' (NOOP) command to keep the connection alive. Default: 10000

Beyond this, the connection could fail so error handle it in that case if you need ftp to reconnect.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 BGPHiJACK