Permalink
Browse files

[fix] relay error events

  • Loading branch information...
AndreasMadsen committed Mar 4, 2012
1 parent 447cdd5 commit f2d023a4ecf4423fb78a2c9d582b7608dba67882
Showing with 6 additions and 0 deletions.
  1. +6 −0 lib/layers/TCP.js
View
@@ -76,6 +76,9 @@
this.emit('listening');
}
+ // relay errors
+ this.object.on('error', this.emit.bind(this, 'error'));
+
// relay the close event
this.object.on('close', this.emit.bind(this, 'close'));
@@ -145,6 +148,9 @@
this.object = net.createConnection(this.object.port, this.object.host);
}
+ // relay errors
+ this.object.on('error', this.emit.bind(this, 'error'));
+
// when socket is closed we will emit the close event
this.object.on('close', this.emit.bind(this, 'close'));

0 comments on commit f2d023a

Please sign in to comment.