diff options
author | Ryan Dahl <ry@tinyclouds.org> | 2010-10-27 12:08:47 -0700 |
---|---|---|
committer | Ryan Dahl <ry@tinyclouds.org> | 2010-10-27 12:09:16 -0700 |
commit | 38dde9684f43dff636d1b798e7537b93d2b6b7fd (patch) | |
tree | c673648b1d27f47df357dfbbeaff7d8762f92098 /benchmark | |
parent | aeb9bed63e3521088aef3b919ac5129a9822e83c (diff) | |
download | node-new-38dde9684f43dff636d1b798e7537b93d2b6b7fd.tar.gz |
Add extra anti-DoS tech to net.Server
Diffstat (limited to 'benchmark')
-rw-r--r-- | benchmark/idle_clients.js | 17 |
1 files changed, 1 insertions, 16 deletions
diff --git a/benchmark/idle_clients.js b/benchmark/idle_clients.js index 65988ab3ad..da96b8ac65 100644 --- a/benchmark/idle_clients.js +++ b/benchmark/idle_clients.js @@ -4,21 +4,6 @@ var errors = 0, connections = 0; var lastClose = 0; -function maybeConnect (s) { - var now = new Date(); - if (now - lastClose > 5000) { - // Just connect immediately - connect(); - } else { - // Otherwise wait a little - see if this one is connected still. Just to - // avoid spinning at 100% cpu when the server totally rejects our - // connections. - setTimeout(function () { - if (s.writable && s.readable) connect(); - }, 100); - } -} - function connect () { process.nextTick(function () { var s = net.Stream(); @@ -28,7 +13,7 @@ function connect () { s.on('connect', function () { gotConnected = true; connections++; - maybeConnect(s); + connect(); }); s.on('close', function () { |