[Martin v. Löwis] > I think the Windows interpretation is actually well-designed: FD_SETSIZE > shouldn't be the number of the largest descriptor, but instead be the > maximum size of the set.
It's more that the fdset macros were well designed: correct code using FD_SET() etc is portable across Windows and Linux, and that's so because the macros define an interface rather than an implementation. BTW, note that the first argument to select() is ignored on Windows. > So FD_SETSIZE is 64 on Windows, In Python FD_SETSIZE is 512 on Windows (see the top of selectmodule.c). > but you still can have much larger file descriptor numbers. Which is the _source_ of "the problem" on Windows: Windows socket handles aren't file descriptors (if they were, they'd be little integers ;-)). > ... > In any case, POSIX makes it undefined what FD_SET does when the > socket is larger than FD_SETSIZE, and apparently clearly expects > an fd_set to be a bit mask. Yup -- although the people who designed the fdset macros to begin with didn't appear to have this assumption. _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com