Permalink
Browse files

Update lib/dnode.js

It's very handy to know which connection ended/failed. Please pull in this simple update to enable callbacks with the object instance.
  • Loading branch information...
1 parent 3aed873 commit a1bf1cbf2c9469afc0898ed1b480e00552c86745 @akumpf committed Sep 12, 2012
Showing with 3 additions and 3 deletions.
  1. +3 −3 lib/dnode.js
View
@@ -64,12 +64,12 @@ dnode.prototype._createProto = function () {
proto.on('fail', function (err) {
// errors that the remote end was responsible for
- self.emit('fail', err);
+ self.emit('fail', err, self);
});
proto.on('error', function (err) {
// errors that the local code was responsible for
- self.emit('error', err);
+ self.emit('error', err, self);
});
return proto;
@@ -144,7 +144,7 @@ dnode.prototype.end = function () {
this._ended = true;
this.writable = false;
this.readable = false;
- this.emit('end');
+ this.emit('end', this);
};
dnode.prototype.destroy = function () {

0 comments on commit a1bf1cb

Please sign in to comment.