mailing list archives
Re: get_max_open_descriptors() is more generous than Nsock.
From: "Luis MartinGarcia." <luis.mgarc () gmail com>
Date: Mon, 19 Dec 2011 15:16:26 +0100
On 12/19/2011 03:10 PM, Henri Doreau wrote:
2011/12/19 Luis MartinGarcia. <luis.mgarc () gmail com>:
How complicated would it be to implement something like
libnetutil::get_max_open_descriptors() in Nsock? (that function is
basically just a wrapper for getrlimit()) Personally, I think it would
be useful to be able to determine the maximum number of descriptors that
Nsock can handle at runtime.
I am not an expert on Nsocks internals but If that is easy to do, then I
think it is a much cleaner approach than providing getters to determine
the underlying engine and then try to guess the max number of
descriptors. What do you think?
rlimit gives limitations for the whole process and nsock has
limitations (or not) per nsock_pool. Callers can of course open
several pools in parallel (though I think it's not the case in nmap
and its companion tools).
A get_max_open_descriptors()-like function in nsock could return
min(<engine limit>, <rlimit>) and let the users deal with multiple
pools if they have some. That would be easy to implement. The fallback
engine (select-based) will be the only one with such a limitation.
I agree that functions directly returning the information would be
much cleaner, that's what I was thinking about.
That sounds great, Henri.
I'm going to add a new item to Nping's to-do list so I can look into
this again the day the nsock-engines branch gets merged.
Thanks a lot! Best regards,
Sent through the nmap-dev mailing list
Archived at http://seclists.org/nmap-dev/