You may have reached the limit of the process for open file descriptors.
I'm not sure if I understand you correctly. Do you have server and client side in the same process? Then you will use twice as many file descriptors. This is close to what you see with ulimit. If this is not the case, the problem may be on the server side? Perhaps the server process is running out of handles and can no longer accept any connections.
accept the man page mentions that you should get the return value:
EMFILE
The process limit for open file descriptors has been reached.
ENFILE
The system limit on the total number of open files has been reached.
What error code are you getting? Obviously, you can only add connections that _accept_ed have successfully added to select or poll.
I know that you already know how to check ulimit, but others may:
ulimit -a core file size (blocks, -c) 0 data seg size (kbytes, -d) unlimited scheduling priority (-e) 0 file size (blocks, -f) unlimited pending signals (-i) 40448 max locked memory (kbytes, -l) 32 max memory size (kbytes, -m) unlimited open files (-n) 4096 pipe size (512 bytes, -p) 8 POSIX message queues (bytes, -q) 819200 real-time priority (-r) 0 stack size (kbytes, -s) 8192 cpu time (seconds, -t) unlimited max user processes (-u) 40448 virtual memory (kbytes, -v) unlimited file locks (-x) unlimited
lothar
source share