On May 22, 02014, at 4:33, Nuno Barros <
legali...@gmail.com> wrote:
> yes i need them to stay keepalive state, my objective is to create 100 http conectins if no error is given + 100 till i can check a max of nat ports in a router
That doesn’t sound like you need keepalive state, just open sockets.
That’s probably not what you want. You don’t want to use GET (No body, whole request is sent and then socket can be closed)
try something like so:
http_options.method = ‘POST’;
var req = http.request({method: ‘POST’, path: ‘/‘, agent: false, hostname: ‘193.136.212.161’}, function (res) {});
setTimeout(function () { req.end(‘.’); }, 10000);
That should start the request right away but not complete it for ten seconds.