diff --git a/benchmark/http_simple.js b/benchmark/http_simple.js index 810633a6ad..75295affb2 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 e3423ea8a1..3e04ae59e7 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++; }