diff --git a/lib/jsftp.js b/lib/jsftp.js index ebd8e8f..ab4c82f 100644 --- a/lib/jsftp.js +++ b/lib/jsftp.js @@ -103,6 +103,9 @@ Ftp.prototype._createSocket = function(port, host, firstAction = NOOP) { : createConnection(port, host, firstAction); this.socket.on("connect", this.reemit("connect")); this.socket.on("timeout", this.reemit("timeout")); + + this.socket.on("close", this.reemit("close")); + this.socket.on("end", this.reemit("end")); this.pipeline = combine(this.socket, this.resParser);