Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Updated to work with http.Client in node 0.3.x

  • Loading branch information...
commit 08452ade4c6f5050a2a56672fa471927399d491f 1 parent 03200f1
Chris Winberry authored
Showing with 7 additions and 7 deletions.
  1. +7 −7 client.js
14 client.js
View
@@ -7,7 +7,7 @@ var serverHost = 'localhost';
var serverPath = '/';
var clientCreationDelay = 0.01 * 1000;
var reportDelay = 5 * 1000;
-var clientLimit = 100;
+var clientLimit = 1000;
var responseCount = 0;
var clients = [];
@@ -19,14 +19,13 @@ function handleClientConnect () { }
function handleClientClose (self) {
if (self.loop)
- self.get(serverPath, { "Host": serverHost })
- .finish(handleRequestFinish);
+ self.request(serverPath, { "Host": serverHost })
+ .addListener("response", handleRequestFinish);
}
function handleResponseBody (chunk) { }
function handleRequestFinish (res) {
- //res.addListener('body', handleResponseBody);
res.addListener('complete', handleResponseComplete);
}
@@ -98,6 +97,7 @@ sys.puts("Starting clients to load test http://" + serverHost + ":" + serverPort
checkClientCount();
-repl.scope.add = add;
-repl.scope.rem = rem;
-repl.start();
+var replConext = repl.start().context
+replConext.add = add;
+replConext.rem = rem;
+
Please sign in to comment.
Something went wrong with that request. Please try again.