Do not emit 'end' twice from Connection on close
This commit is contained in:
parent
96e4afdb1b
commit
e1b1c62e3e
@ -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');
|
||||
});
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user