diff options
author | Ryan Dahl <ry@tinyclouds.org> | 2010-02-18 02:36:50 +0300 |
---|---|---|
committer | Ryan Dahl <ry@tinyclouds.org> | 2010-02-18 02:37:12 +0300 |
commit | 7c1c89fc29ccb1a27fb132e9299b5bb240b51df5 (patch) | |
tree | 0003937c1c1cdeb03dc20c4c7bc8c8038ab911b9 /benchmark | |
parent | 916d592be185eee86d16c87df120ed70f61186fa (diff) |
Update benchmark script to new API
Diffstat (limited to 'benchmark')
-rw-r--r-- | benchmark/http_simple.js | 3 | ||||
-rw-r--r-- | benchmark/static_http_server.js | 10 |
2 files changed, 8 insertions, 5 deletions
diff --git a/benchmark/http_simple.js b/benchmark/http_simple.js index 810633a6ad7..75295affb23 100644 --- a/benchmark/http_simple.js +++ b/benchmark/http_simple.js @@ -53,6 +53,5 @@ http.createServer(function (req, res) { } ); res.write(body); - - res.finish(); + res.close(); }).listen(8000); diff --git a/benchmark/static_http_server.js b/benchmark/static_http_server.js index e3423ea8a18..3e04ae59e75 100644 --- a/benchmark/static_http_server.js +++ b/benchmark/static_http_server.js @@ -21,14 +21,16 @@ var server = http.createServer(function (req, res) { "Content-Length": body.length }); res.write(body); - res.finish(); + res.close(); }) server.listen(port); function responseListener (res) { res.addListener("end", function () { if (requests < n) { - res.client.request("/").finish(responseListener); + var req = res.client.request("/"); + req.addListener('response', responseListener); + req.close(); requests++; } @@ -41,6 +43,8 @@ function responseListener (res) { for (var i = 0; i < concurrency; i++) { var client = http.createClient(port); client.id = i; - client.request("/").finish(responseListener); + var req = client.request("/"); + req.addListener('response', responseListener); + req.close(); requests++; } |