diff --git a/lib/connection.js b/lib/connection.js index 997b0a73..c5fc1696 100644 --- a/lib/connection.js +++ b/lib/connection.js @@ -56,14 +56,10 @@ Connection.prototype.connect = function(port, host) { self.emit('error', error); }); - this.stream.on('end', function() { - self.emit('end'); - }); - this.stream.on('close', function() { - // TODO: avoid emitting 'end' twice ? - // node-0.10 emits both 'end' and 'close' - // for streams closed by the peer + // NOTE: node-0.10 emits both 'end' and 'close' + // for streams closed by the peer, while + // node-0.8 only emits 'close' self.emit('end'); });