I try to get some C++ code from Windows platform to Mac OSX/Linux. The Windows implementation uses sockets and the select statement. Under Windows the fd_set given to select is defined as followed:
typedef struct fd_set {
u_int fd_count; /* how many are SET? */
SOCKET fd_array[FD_SETSIZE]; /* an array of SOCKETs */
} fd_set;
which is pretty bad, because FD_SETSIZE is small and I had to build a more dynamic approach which gives some trouble on 64bit Windows. Resolving all these problems on Windows, I run into problems on unix/linux/OSX because the fd_set looks there totally different.
Now the question. Is there a socket count limitation like in windows? What is a good solution work under Linux and Windows. If there is a limitation in socket count, what is the best workaround?