diff options
author | Joe George <joe@zeroc.com> | 2014-10-16 14:42:31 -0400 |
---|---|---|
committer | Joe George <joe@zeroc.com> | 2014-10-16 14:42:31 -0400 |
commit | 8fb38cf1e5f8db5e4285ae43a77b0ba432b51cc6 (patch) | |
tree | db3e270275f650bdc364987913a741a949833bba /js/demo/Ice/latency/browser/Client.js | |
parent | adding php.ini (diff) | |
download | ice-8fb38cf1e5f8db5e4285ae43a77b0ba432b51cc6.tar.bz2 ice-8fb38cf1e5f8db5e4285ae43a77b0ba432b51cc6.tar.xz ice-8fb38cf1e5f8db5e4285ae43a77b0ba432b51cc6.zip |
ICE-5749 - Replace Promise with Ice.Promise in demos
Diffstat (limited to 'js/demo/Ice/latency/browser/Client.js')
-rw-r--r-- | js/demo/Ice/latency/browser/Client.js | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/js/demo/Ice/latency/browser/Client.js b/js/demo/Ice/latency/browser/Client.js index 3a86f26c7ed..b8344cfbfeb 100644 --- a/js/demo/Ice/latency/browser/Client.js +++ b/js/demo/Ice/latency/browser/Client.js @@ -9,8 +9,6 @@ (function(){ -var Promise = Ice.Promise; - // // Initialize the communicator // @@ -26,13 +24,13 @@ function run() // var hostname = document.location.hostname || "127.0.0.1"; var secure = document.location.protocol.indexOf("https") != -1; - var ref = secure ? + var ref = secure ? "ping:wss -h " + hostname + " -p 9090 -r /demowss" : "ping:ws -h " + hostname + " -p 8080 -r /demows"; var proxy = communicator.stringToProxy(ref); - + var repetitions = 1000; - + // // Down-cast the proxy to the Demo.Ping interface. // @@ -42,7 +40,7 @@ function run() writeLine("pinging server " + repetitions + " times (this may take a while)"); start = new Date().getTime(); return loop( - function() + function() { return obj.ice_ping(); }, @@ -97,11 +95,11 @@ $("#run").click( // // Asynchronous loop: each call to the given function returns a // promise that when fulfilled runs the next iteration. -// +// function loop(fn, repetitions) { var i = 0; - var next = function() + var next = function() { if(i++ < repetitions) { @@ -123,9 +121,9 @@ function writeLine(msg) // // Handle the client state. // -var State = { - Idle:0, - Running: 1 +var State = { + Idle:0, + Running: 1 }; var state; |