From 24224b81487b76343705dbe700399aa854a4dc46 Mon Sep 17 00:00:00 2001 From: Brandon Alexander Date: Mon, 29 Aug 2011 16:44:36 -0500 Subject: [PATCH] Destroys the socket on error instead of end. When only calling socket.end(), the socket would still respond to timeout events. --- lib/portscanner.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/portscanner.js b/lib/portscanner.js index 9e7fe90..d95a15b 100644 --- a/lib/portscanner.js +++ b/lib/portscanner.js @@ -68,7 +68,7 @@ portscanner.checkPortStatus = function(port, host, callback) { // Assuming the port is not open if an error. May need to refine based on // exception socket.on('error', function(exception) { - socket.end() + socket.destroy() callback(null, 'closed') })