summaryrefslogtreecommitdiff
path: root/test/simple/test-net-server-max-connections.js
diff options
context:
space:
mode:
authorOleg Efimov <efimovov@gmail.com>2010-12-05 22:15:30 +0300
committerRyan Dahl <ry@tinyclouds.org>2010-12-05 15:41:58 -0800
commit0665f0271e71270dc23ec5231b245adfe709a49f (patch)
tree5679d97d06ac451bf33d60c17bbdcb57967907da /test/simple/test-net-server-max-connections.js
parent47c40bf18d393654b4f1d64ad386486c3f248942 (diff)
downloadnode-new-0665f0271e71270dc23ec5231b245adfe709a49f.tar.gz
GJSLint all simple tests exclude http-*, url, path
Diffstat (limited to 'test/simple/test-net-server-max-connections.js')
-rw-r--r--test/simple/test-net-server-max-connections.js20
1 files changed, 12 insertions, 8 deletions
diff --git a/test/simple/test-net-server-max-connections.js b/test/simple/test-net-server-max-connections.js
index f404ad5f3d..293880931c 100644
--- a/test/simple/test-net-server-max-connections.js
+++ b/test/simple/test-net-server-max-connections.js
@@ -26,12 +26,12 @@ server.listen(common.PORT, function() {
}
});
-server.maxConnections = N/2;
+server.maxConnections = N / 2;
console.error('server.maxConnections = %d', server.maxConnections);
-function makeConnection (index) {
+function makeConnection(index) {
setTimeout(function() {
var c = net.createConnection(common.PORT);
var gotData = false;
@@ -51,12 +51,14 @@ function makeConnection (index) {
console.error('closed %d', index);
closes++;
- if (closes < N/2) {
- assert.ok(server.maxConnections <= index,
- index + ' was one of the first closed connections but shouldnt have been');
+ if (closes < N / 2) {
+ assert.ok(server.maxConnections <= index,
+ index +
+ ' was one of the first closed connections ' +
+ 'but shouldnt have been');
}
- if (closes === N/2) {
+ if (closes === N / 2) {
var cb;
console.error('calling wait callback.');
while (cb = waits.shift()) {
@@ -66,9 +68,11 @@ function makeConnection (index) {
}
if (index < server.maxConnections) {
- assert.equal(true, gotData, index + ' didn\'t get data, but should have');
+ assert.equal(true, gotData,
+ index + ' didn\'t get data, but should have');
} else {
- assert.equal(false, gotData, index + ' got data, but shouldn\'t have');
+ assert.equal(false, gotData,
+ index + ' got data, but shouldn\'t have');
}
});
}, index);