       callback?(result)
     )
 
+  # PERIDOT_HTTP_TIMEOUT = 600000 # for debugging
+  PERIDOT_HTTP_TIMEOUT = 3000
+
   ###*
   Download sketch
   ###


  stop: (callback) ->
    req = @newHttpRequest()
    req.timeout = 3000
    req.onreadystatechange = ->
      callback?(not req.errorFlag) if req.readyState == req.DONE
    req.open("POST", "http://#{SERVER_HOST}/stop")


  test: (callback) ->
    req = @newHttpRequest()
    req.timeout = PERIDOT_HTTP_TIMEOUT
    req.onreadystatechange = ->
      switch req.readyState
        when req.DONE
