If i set agent: false I see from time to time:

Error: socket hang up
at createHangUpError (http.js:1373:15)
at Socket.socketCloseListener (http.js:1424:23)
at Socket.EventEmitter.emit (events.js:96:17)
at Socket._destroy.destroyed (net.js:358:10)
at process.startup.processNextTick.process._tickCallback (node.js:244:9)

Am Donnerstag, 28. Februar 2013 11:00:00 UTC+1 schrieb Michael:
>
> Hi,
>
> i make a lot of http calls to my backend. I use a custom
> var myagent = new http.Agent();
> myagent.maxSockets = 50;
> for my requests. If i make 51 requests at a time, the last request will 
> see an error:
> Error: socket hang up
> at createHangUpError (http.js:1373:15)
> at Socket.socketOnEnd [as onend] (http.js:1470:23)
> at TCP.onread (net.js:419:26)'
> I do my requests like this:
> var req = http.request({
> host: "localhost",
> port: 9999,
> path: "/api/test",
> method: "POST",
> headers: {
> "accept": "application/json",
> "accept-charset": "utf-8",
> "connection": "keep-alive"
> },
> agent: myagent
> });
> req.on("response", function (response) { ... });
> req.on("error", function(e) { ... });
> req.end("{}", "utf8");
>
>
> As far as I understand the agent, the request should just wait in the 
> queue until one of the requests is finished to get picked up.
>
> ECONNRESET seems to mean something like sending data after the socket is 
> closed.
>
>
> If i set  agent: false or if I don't reach the maximum amount of requests 
> everything is fine.
>
>

-- 
-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

--- 
You received this message because you are subscribed to the Google Groups 
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to