WIN sock specific fd range check

This commit is contained in:
Jeff Hill
1996-08-05 19:16:27 +00:00
parent 20880b3950
commit 7d342b5276
+22 -3
View File
@@ -78,13 +78,32 @@ int cac_select_io(struct timeval *ptimeout, int flags)
continue;
}
if (piiu->sock_chan>=FD_SETSIZE) {
#ifdef WIN32
/* Under WIN32, FD_SETSIZE is the number of sockets,
* not the max. file descriptor value that you may select() !
*
* Of course it's not allowed to look into fd_count,
* but what shall we do? -kuk-
*/
if (pfdi->readMask.fd_count >= FD_SETSIZE)
{
ca_printf(
"%s.%d: file number > FD_SETSIZE=%d ignored\n",
__FILE__, __LINE__, FD_SETSIZE);
"%s.%d: no room for fd %d in fd_set (FD_SETSIZE=%d)\n",
__FILE__, __LINE__, piiu->sock_chan, FD_SETSIZE);
continue;
}
#else
if (piiu->sock_chan>=FD_SETSIZE)
{
ca_printf(
"%s.%d: file number %d > FD_SETSIZE=%d ignored\n",
__FILE__, __LINE__, piiu->sock_chan, FD_SETSIZE);
continue;
}
#endif
/*
* Dont bother receiving if we have insufficient
* space for the maximum UDP message