The accept() or accept4() function returns an integer but if I received more than INT_MAX clients connections, what will happen?
The accept() or accept4() function returns an integer but if I received more than INT_MAX clients connections, what will happen?
What will happen??
The accept call will fail. It will however most likely fail long before you reach INT_MAX with something like EMFILE "The per-process limit on the number of open file descriptors has been reached." in Linux.
In reality, this will unlikely happen. When you've closed a socket, the used file descriptor is available for re-use again - and you are not likely going to attempt to serve ~2.1 billion clients at the same time on a single computer.