summaryrefslogtreecommitdiff
path: root/test/pummel/test-net-many-clients.js
diff options
context:
space:
mode:
authorRyan Dahl <ry@tinyclouds.org>2010-07-15 11:47:25 -0700
committerRyan Dahl <ry@tinyclouds.org>2010-07-15 14:21:31 -0700
commit9fd5e3c89cb3664be7491c2da8e7060a0c36e135 (patch)
treed748de58c1638e852d33374c328a45f6ab8d2268 /test/pummel/test-net-many-clients.js
parent94728125696ce05f5308ccbc111874e9fa936936 (diff)
downloadandroid-node-v8-9fd5e3c89cb3664be7491c2da8e7060a0c36e135.tar.gz
android-node-v8-9fd5e3c89cb3664be7491c2da8e7060a0c36e135.tar.bz2
android-node-v8-9fd5e3c89cb3664be7491c2da8e7060a0c36e135.zip
Update tests to work with module contexts
Diffstat (limited to 'test/pummel/test-net-many-clients.js')
-rw-r--r--test/pummel/test-net-many-clients.js9
1 files changed, 5 insertions, 4 deletions
diff --git a/test/pummel/test-net-many-clients.js b/test/pummel/test-net-many-clients.js
index fe026b9c6b..9d123e7ca9 100644
--- a/test/pummel/test-net-many-clients.js
+++ b/test/pummel/test-net-many-clients.js
@@ -1,4 +1,5 @@
-require("../common");
+common = require("../common");
+assert = common.assert
net = require("net");
// settings
var bytes = 1024*40;
@@ -23,7 +24,7 @@ var server = net.createServer(function (c) {
});
function runClient (callback) {
- var client = net.createConnection(PORT);
+ var client = net.createConnection(common.PORT);
client.connections = 0;
@@ -59,14 +60,14 @@ function runClient (callback) {
assert.ok(!client.fd);
if (this.connections < connections_per_client) {
- this.connect(PORT);
+ this.connect(common.PORT);
} else {
callback();
}
});
}
-server.listen(PORT, function () {
+server.listen(common.PORT, function () {
var finished_clients = 0;
for (var i = 0; i < concurrency; i++) {
runClient(function () {