From fcad5e35fd03ce0066ed4d9b56c93e4d945728fd Mon Sep 17 00:00:00 2001 From: Bert Belder Date: Fri, 7 Oct 2011 19:00:48 +0200 Subject: [PATCH] Black hole tcp reads after destroy() --- lib/net_uv.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/net_uv.js b/lib/net_uv.js index 4595f8a46be..2e103609f6f 100644 --- a/lib/net_uv.js +++ b/lib/net_uv.js @@ -4,6 +4,8 @@ var timers = require('timers'); var util = require('util'); var assert = require('assert'); +function noop() {}; + // constructor for lazy loading function createPipe() { var Pipe = process.binding('pipe_wrap').Pipe; @@ -267,6 +269,7 @@ Socket.prototype.destroy = function(exception) { debug('close'); if (this._handle) { this._handle.close(); + this._handle.onread = noop; this._handle = null; }