|
|
@ -3,6 +3,10 @@ assert = common.assert |
|
|
|
net = require("net"); |
|
|
|
N = 160*1024; // 30kb
|
|
|
|
|
|
|
|
|
|
|
|
chars_recved = 0; |
|
|
|
npauses = 0; |
|
|
|
|
|
|
|
console.log("build big string"); |
|
|
|
var body = ""; |
|
|
|
for (var i = 0; i < N; i++) { |
|
|
@ -17,13 +21,7 @@ server = net.createServer(function (connection) { |
|
|
|
connection.end(); |
|
|
|
}); |
|
|
|
}); |
|
|
|
server.listen(common.PORT); |
|
|
|
|
|
|
|
|
|
|
|
chars_recved = 0; |
|
|
|
npauses = 0; |
|
|
|
|
|
|
|
|
|
|
|
server.listen(common.PORT, function () { |
|
|
|
var paused = false; |
|
|
|
client = net.createConnection(common.PORT); |
|
|
|
client.setEncoding("ascii"); |
|
|
@ -49,6 +47,9 @@ client.addListener("end", function () { |
|
|
|
server.close(); |
|
|
|
client.end(); |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
process.addListener("exit", function () { |
|
|
|
assert.equal(N, chars_recved); |
|
|
|