Skip to content

Commit

Permalink
Fixes multiple callbacks when checking port status.
Browse files Browse the repository at this point in the history
This is a regression issue after updating from v0.4.x to v0.6.x of Node.
  • Loading branch information
baalexander committed Nov 29, 2011
1 parent 19a8c1d commit a60a248
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions lib/portscanner.js
Expand Up @@ -67,14 +67,12 @@ portscanner.checkPortStatus = function(port, host, callback) {
socket.setTimeout(400)
socket.on('timeout', function() {
status = 'closed'
socket.end()
})

// Assuming the port is not open if an error. May need to refine based on
// exception
socket.on('error', function(exception) {
status = 'closed'
socket.destroy()
})

// Return after the socket has closed
Expand Down

0 comments on commit a60a248

Please sign in to comment.