Subject: Re: reached select() limit

Re: reached select() limit

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Wed, 25 Jan 2017 15:17:33 +0100 (CET)

On Wed, 25 Jan 2017, David Guillen Fandos wrote:

> Yeah agreed, but how do you retrieve the fds to use poll? With getsock you
> get up to 16 sockets which is insufficient for my needs (and also, BTW,
> sounds like an arbitrary and ridiculous number to hardcode in such a
> function)

Arbitrary? Not really, it happens to be the number that fits in an unsigned
32bit variable as each socket needs two bits in the API. I just considered it
a dececently convenient API at the time (and happens to be similar to a
function interface we use internally in libcurl).

Ridiculous? Maybe, but I added that API a long time ago and I have yet to end
up in a case where the 16 limit has been reached and impacted us (or anyone
else). I added this API to allow libcurl to use c-ares event-based and we've
since used it with many thousand simultaneous requests and DNS looks with
success - over the period of many years.

Can it be improved? I'm sure.

-- 
  / daniel.haxx.se
Received on 2017-01-25