summaryrefslogtreecommitdiff
path: root/lib/net.js
diff options
context:
space:
mode:
Diffstat (limited to 'lib/net.js')
-rw-r--r--lib/net.js13
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/net.js b/lib/net.js
index 02fd187480..7e5d0ea621 100644
--- a/lib/net.js
+++ b/lib/net.js
@@ -1653,6 +1653,19 @@ function emitCloseNT(self) {
}
+Server.prototype[EventEmitter.captureRejectionSymbol] = function(
+ err, event, sock) {
+
+ switch (event) {
+ case 'connection':
+ sock.destroy(err);
+ break;
+ default:
+ this.emit('error', err);
+ }
+};
+
+
// Legacy alias on the C++ wrapper object. This is not public API, so we may
// want to runtime-deprecate it at some point. There's no hurry, though.
ObjectDefineProperty(TCP.prototype, 'owner', {