diff --git a/lib/client/client.js b/lib/client/client.js index 7082ea8..78f8a47 100644 --- a/lib/client/client.js +++ b/lib/client/client.js @@ -939,9 +939,9 @@ Client.prototype._connect = function _connect() { return; } connectSocket(function (err) { - self.connecting = false; if (!err) { postSetup(); + self.connecting = false; self.connected = true; self.emit('connect', socket); self.log.debug('connected after %d attempt(s)', num+1);