Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

node 7.* does not read from socket stream #219

Open
erkie opened this issue Dec 21, 2016 · 0 comments
Open

node 7.* does not read from socket stream #219

erkie opened this issue Dec 21, 2016 · 0 comments

Comments

@erkie
Copy link

erkie commented Dec 21, 2016

In Node 7:

var Ftp = require("jsftp");

var ftp = new Ftp({...});
ftp.get("myfile", function(err, socket) {
    socket.on("data", function() {
        console.log("read chunk");
    });
});

This code does not work. The socket/stream does never read anything. I noticed that socket.pause() is called in jsftp.js. So you need to manually call socket.resume(); for it to fetch data again.

var Ftp = require("jsftp");

var ftp = new Ftp({...});
ftp.get("myfile", function(err, socket) {
    socket.on("data", function() {
        console.log("read chunk");
    });
    socket.resume();
});

Either this is a bug, or the documentation needs amending. Thoughts?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant