           # The WebSocket connection has been established
           @sock.once 'open', =>
             logger.info "Pub/Sub WebSocket opened."
-            hasConnected = true
+            @hasConnected = true
+            @autoReconnectDelay = defaultReconnectDelay
 
             setImmediate => @emit 'open'
 

        resolve()
      else
        data = auth.socketAuth @keys, @sessionUuid
        hasConnected = false

        if data?
          logger.info "Finished assembling auth data:\n

          @sock.on 'error', (error) =>
            setImmediate => @emit 'error', error

            if not @hasConnected
              logger.error "WebSocket connect error:", error
              reject error
            else
