]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
SF bug 110843: Low FD_SETSIZE limit on Win32 (PR#41). Boosted to 512.
authorTim Peters <tim.peters@gmail.com>
Tue, 12 Dec 2000 01:18:41 +0000 (01:18 +0000)
committerTim Peters <tim.peters@gmail.com>
Tue, 12 Dec 2000 01:18:41 +0000 (01:18 +0000)
Misc/NEWS
Modules/selectmodule.c

index ed29fcbf1c9b253a3cef7a8ab6c145c51cfc1ca0..2b1d7b8faf79ec1b5fff57f6c9a20e33e96b93dd 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -27,6 +27,14 @@ Core language, builtins, and interpreter
   fit in an int.  In 1.6 and earlier, a negative long formatted
   via %u raised an error if it was too big to fit in an int.
 
+Windows changes
+
+- select module:  By default under Windows, a select() call
+  can specify no more than 64 sockets.  Python now boosts
+  this Microsoft default to 512.  If you need even more than
+  that, see the MS docs (you'll need to #define FD_SETSIZE
+  and recompile Python from source).
+
 
 What's New in Python 2.0?
 =========================
index 008ffa4dd20f7df347b55a415b87c9f95fe1ec65..de910c6077e1643b27de5e7e1ea088fa696b8875 100644 (file)
@@ -1,4 +1,3 @@
-
 /* select - Module containing unix select(2) call.
    Under Unix, the file descriptors are small integers.
    Under Win32, select only exists for sockets, and sockets may
@@ -9,6 +8,16 @@
 
 #include "Python.h"
 
+/* Windows #defines FD_SETSIZE to 64 if FD_SETSIZE isn't already defined.
+   64 is too small (too many people have bumped into that limit).
+   Here we boost it.
+   Users who want even more than the boosted limit should #define
+   FD_SETSIZE higher before this; e.g., via compiler /D switch.
+*/
+#if defined(MS_WINDOWS) && !defined(FD_SETSIZE)
+#define FD_SETSIZE 512
+#endif 
+
 #ifdef HAVE_UNISTD_H
 #include <unistd.h>
 #endif