 # a new kite.
 MAX_HEARTBEATS = 60
 # The default heartbeat interval, in seconds.
-HEARTBEAT_INTERVAL = 5
+HEARTBEAT_INTERVAL = 10
+# The default number of seconds that heartbeat will wait, before
+# starting.
+HEARTBEAT_DELAY = 15
 
 
 # Not exported


      clearInterval intervalId

      # Check the old kites vs the new kites
      newKite = null
      for kite in kites
        if oldKites[kite.keyId]
          newKite = kite
          break


    queryPromise.catch (err) ->
      kallback err  if err

  # The delay serves to give klient time to connect, reducing unneeded
  # heartbeats.
  heartbeatDelay = HEARTBEAT_DELAY - interval
  heartbeatDelay = 0  if heartbeatDelay < 0

  setTimeout (->
      intervalId = setInterval heartbeat, interval * 1000
  ), heartbeatDelay * 1000
  return


