Permalink
Browse files

FD_SETSIZE must be defined before winsock2.h to increase 64 fd limit …

…on windows
  • Loading branch information...
1 parent 42c2610 commit 3a82371af64b8a6e1874252cfc585ac2822431ac @tmm1 tmm1 committed Oct 3, 2009
Showing with 3 additions and 3 deletions.
  1. +3 −3 ext/project.h
View
@@ -81,6 +81,9 @@ typedef int SOCKET;
#endif /* OS_UNIX */
#ifdef OS_WIN32
+// 21Sep09: windows limits select() to 64 sockets by default, we increase it to 1024 here (before including winsock2.h)
+#define FD_SETSIZE 1024
+
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <winsock2.h>
@@ -91,9 +94,6 @@ typedef int SOCKET;
typedef int socklen_t;
typedef int pid_t;
-
-// 21Sep09: windows limits select() to 64 sockets by default, we increase it to 1024 here
-#define FD_SETSIZE 1024
#endif

0 comments on commit 3a82371

Please sign in to comment.