 
       # When the WebSocket opens, send any requests enqueued.
       socket.addEventListener 'open', ->
+        backOff.reset()
+
         notify.info 'Connected to XO-Server'
-
-        delay = null
 
         # If there is a token tries to sign in.
         if (token = $cookieStore.get 'token')


    # Currently logged in user.
    user = null

    # Function used to send requests when the socket is opened.
    send = (method, params, deferred) ->

        # New requests are sent directly.
        call = send

      socket.addEventListener 'close', -> backOff.backOff()

      # When a message is received, we call the corresponding
      # deferred (if any).
