     try
       args = JSON.parse evt.data
       {method} = args
-      # console.log "received", {args}
-      callback = @localStore.get method
+      callback = switch method
+        when 'ping'             then @bound 'handlePing'
+        else (@localStore.get method) ? ->
+
+      # callback = @localStore.get method
       callback.apply this, @unscrub args
     catch e
       console.log "error: ", e, evt.data
 
   onError: (evt) ->
     # console.log "#{@kiteName}: error #{evt.data}"
+
+  handlePing: ->
+    @send JSON.stringify
+      method      : 'pong'
+      arguments   : []
+      callbacks   : {}
 
   initBackoff:(options)->
     backoff = options.backoff ? {}

      callback scrubbed

  tell:(options, callback) ->
    @ready => 
      # token is needed to initiate a valid session
      options.token = @token
      options.username  = "#{KD.nick()}"

    xhr.send JSON.stringify requestData
    xhr.onload = =>
       if xhr.status is 200
          data = JSON.parse xhr.responseText
          @token = data[0].token
          console.log {@token}
          @addr = data[0].addr
          @connectDirectly()
        else
          log "kontrol request error", xhr.responseText

  disconnect:(reconnect=true)->
    @autoReconnect = !!reconnect  if reconnect?
