joyent/node — Issue #1958: big bug for http-agent keep alive??
Author: windyrobin
Created: 2011-10-28 10:00:43+00:00
State: open

I found it doesn't work ,
well ,maybe my test way isn't correct , but please just check keep-alive feature again
I think the test file : test-http-keep-alive.js isn't so valuable.

my test code :

client:

```js
var count = 10;
var agent = new http.Agent({"maxSockets" : 3});
var options = {
host: 'localhost',
port: 3458,
path: '/',
method: 'GET',
agent : agent,
headers : {"Connection" : "keep-alive"}
};

function looptest(){
var req = http.request(options, function(res){
res.on("end", function(){
console.log("count : " + count);
if(--count <= 0){

}else{
process.nextTick(function(){
looptest();
});
}
});
});
req.end();
}

looptest();
```

the server is writen by me ,and when it got connection just print a line
so the result is 10 lines:

get a connection
get a connection
get a connection
get a connection
get a connection
get a connection
get a connection
get a connection
get a connection
get a connection

but when I use (keep-alive mode)
```
siege -c 1 -r 10 localhost:3458/
```
the result is one line :

get a connection

why??