jr wrote:Some googling has led me to believe that fd_set/select is handled differently enough on windows to not require fiddling with FD_SETSIZE at all, but I don't have access to VC to verify this.
On *nix FD_SETSIZE has to be specified before the relevant header (on cygwin this is sys/types.h; I think it is the same on Linux and *BSD) is included, because several other defines are computed from it in the same header. Therefore it is not possible to pick up the default and change it afterwards.
The reason it is necessary at all on cygwin is that cygwin's default is 64, but after initialization 80 FDs are already allocated (this is probably a bug somewhere else, my guess is the *nix code in cDirectoryListing is not closing everything it opens, but I haven't debugged it).
FD_SETSIZE also limits the maximum number of connections, so a reasonable value should be picked (and this dependency should probably be documented somewhere).
I understood what it did, and what it was applibcable for (my point was it doesn't hurt if set on windows, so cound just avoid the platform check if one wanted to).
I suppose I had two main issues that I wanted:
1. If one was going to set FD_SETSIZE, it should be checked first, befure being redefined (and clearly be in the correct place).
2. One could eliminate the platform check.