Skip to content

Commit

Permalink
Destroys the socket on error instead of end.
Browse files Browse the repository at this point in the history
When only calling socket.end(), the socket would still respond to timeout
events.
  • Loading branch information
baalexander committed Aug 29, 2011
1 parent e2c4448 commit 24224b8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/portscanner.js
Original file line number Diff line number Diff line change
Expand Up @@ -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')
})

Expand Down

0 comments on commit 24224b8

Please sign in to comment.