I am developing a server application running under Sun Unix and I would like
to override the default value of FD_SETSIZE (which is 1024) because I need
my process to support more than 1024 simultaneous TCP connections and I
would like to be able to call select() on the whole pile at once.
It is documented in both the Sun man pages and in the system include headers
that you can change FD_SETSIZE simply by #define'ing it before #include'ing
#define FD_SETSIZE 2048
In practice, however, I am finding that I cannot set FD_SETSIZE to any value
larger than 1250. If I do, calls to select() on a fd_set of that size fail
with errno 9 (EBADF). The man pages for select( ) state that if select()
fails with EBADF it means that "One of the I/O file descriptor sets
specified an invalid I/O file descriptor."
I'm in big trouble if I can't support more than 1250 simultaneous TCP
connections...can anyone help with this? How can I support larger values
for FD_SETSIZE in my server without having select() fail?
Thanks in advance for any help you can provide.