Operating System - HP-UX
1826950 Members
3378 Online
109705 Solutions
New Discussion

Re: Select call and 32 descriptors

 
Prashun
Occasional Contributor

Select call and 32 descriptors

Hi
I ma using select calll to multiplex the socket descriptors. As soon as I reach more than 32 the system is creating problem and just freezes out.
Can some body eleborate on this and provide some way to implement about 100 descriptors. All needed to be opened.
Thanks
Prashun
2 REPLIES 2
Vincent Fleming
Honored Contributor

Re: Select call and 32 descriptors

You don't say what version of the OS you're running, but from the select(2) man page for 11i, I got this:

[EINVAL] The nfds argument is less than 0, or is greater than or equal to the value of MAXFUPLIM, which specifies the absolute maximum number of files a process can have open at one time. If the resource limit RLIMIT_NOFILE for a process is less than or equal to 2048, MAXFUPLIM is considered to be 2048.

You may be exceeding the maximum number of open files allowed in your kernel tuning. I would check those kernel tunables.

Good luck
No matter where you go, there you are.
Klaus Crusius
Trusted Contributor

Re: Select call and 32 descriptors


Make sure you are using the ASCII headers and the convenience macros all described on the man page "man 2 select".

Also obey the maximum number of open files for you process. Use "man 2 getrlimit/setrlimit" to increase the per process number of allowed open files.

On HPUX10.02 and HPUX11.0 I did not see problems with that.

Regards, Klaus
There is a live before death!