--
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 nod...@googlegroups.com
To unsubscribe from this group, send email to
nodejs+un...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en
So basically, setting agent:false automatically creates an agent for me instead of using globalAgent?
With the new http module, I'm not sure what the benefit would be to
using agent:false, vs using an agent with a high maxSockets.
Ted
Maybe “1/0“?
Am 12.09.2011 10:10 schrieb "Floby" <floren...@gmail.com>:
For a ridiculously high number you can use Infinity, which is a
special value of Number. You can get it with Math.min().
(yeah Math.max() seems to return negative infinity). I really thought
there was another way to get it.
On Sep 11, 6:56 pm, Ted Young <t...@radicaldesigns.org> wrote:
> If you set agent to false, it will...
--
function min () {
var m = Infinity
for (var i = 0; i < arguments.length; i ++) {
if (arguments[i] < m) m = arguments[i]
}
return m
}
function max () {
var m = -Infinity
for (var i = 0; i < arguments.length; i ++) {
if (arguments[i] > m) m = arguments[i]
}
return m
So basically, setting agent:false automatically creates an agent for me instead of using globalAgent?
Agent.prototype.addRequest = function(req, host, port) {var name = host + ':' + port;if (!this.sockets[name]) {this.sockets[name] = [];}if (this.sockets[name].length < this.maxSockets) {// If we are under maxSockets create a new one.req.onSocket(this.createSocket(name, host, port));} else {// We are over limit so we'll add it to the queue.if (!this.requests[name]) {this.requests[name] = [];}this.requests[name].push(req);}};
Math.min returns Infinity, because it is implemented something like this:
function min () {
var m = Infinity
for (var i = 0; i < arguments.length; i ++) {
if (arguments[i] < m) m = arguments[i]
}
return m
}
function max () {
var m = -Infinity
for (var i = 0; i < arguments.length; i ++) {
if (arguments[i] > m) m = arguments[i]
}
return m
}
A bit of a silly question, but obviously the socket limits are valid per node process, right?