Skip to content

Commit

Permalink
destroy only happens after close
Browse files Browse the repository at this point in the history
  • Loading branch information
kilianc committed Jul 9, 2012
1 parent b18bbb7 commit 4f90420
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/nssocket.js
Expand Up @@ -184,7 +184,6 @@ NsSocket.prototype.reconnect = function reconnect() {


function doReconnect() { function doReconnect() {
self.retry.waiting = true self.retry.waiting = true
self.socket && self.socket.destroy()


// here for debugging reasons // here for debugging reasons
assert.isFalse(self.connected, 'before actually reconnect connected must be false') assert.isFalse(self.connected, 'before actually reconnect connected must be false')
Expand Down Expand Up @@ -273,6 +272,7 @@ function configureEvents(self) {
} }


self.socket.on('close', function onClose(hadError) { self.socket.on('close', function onClose(hadError) {
self.socket.destroy()
self.socket = undefined self.socket = undefined
self.connected = false self.connected = false


Expand Down

0 comments on commit 4f90420

Please sign in to comment.