mscdex / node-ftp

An FTP client module for node.js
MIT License
1.13k stars 246 forks source link

Multiple asynchronous calls to put() breaks with ECONNRESET #211

Open samuelt1 opened 6 years ago

samuelt1 commented 6 years ago

Running multiple asynchronous calls to the put function will break things. the returned error is:

    at _errnoException (util.js:1024:11)
    at TCP.onread (net.js:615:25)
  cause: { Error: read ECONNRESET
    at _errnoException (util.js:1024:11)
    at TCP.onread (net.js:615:25) code: 'ECONNRESET', errno: 'ECONNRESET', syscall: 'read' },
  isOperational: true,
  code: 'ECONNRESET',
  errno: 'ECONNRESET',
  syscall: 'read' }

A simple test for this is:


let promises = []
for(let i = 0;i>100;i++)
promises.push(ftp.put('a file','a/folder/name'+i))

await Promise.All(promises)
edthenet commented 1 year ago

+1