From 1acc1b15820f8c437fae1a5d2f13a8ebbcecbd06 Mon Sep 17 00:00:00 2001 From: Pieter Hintjens Date: Sat, 23 Aug 2014 13:59:53 +0200 Subject: [PATCH] Problem: FD_SETSIZE 1024 is too restrictive under Windows Solution: increased to 4096 by default for all MSVC builds, for MinGW, and for CMake. Note: this is a speculative change, it needs confirmation before we can keep it. Particularly, there is some doubt that changing this in libzmq will affect upstream applications using libzmq.dll. --- CMakeLists.txt | 2 +- builds/mingw32/Makefile.mingw32 | 2 +- builds/msvc/vs2008/libzmq/libzmq.vcproj | 10 +++++----- builds/msvc/vs2010/libzmq/libzmq.props | 2 +- builds/msvc/vs2012/libzmq/libzmq.props | 2 +- builds/msvc/vs2013/libzmq/libzmq.props | 2 +- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3fd2889a..721d1332 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -347,7 +347,7 @@ if(MSVC) -DWIN32 -DDLL_EXPORT # NB: May require tweaking for highly connected applications. - -DFD_SETSIZE=1024 + -DFD_SETSIZE=4096 -D_CRT_SECURE_NO_WARNINGS) # Parallel make. diff --git a/builds/mingw32/Makefile.mingw32 b/builds/mingw32/Makefile.mingw32 index e54135e0..840fad98 100644 --- a/builds/mingw32/Makefile.mingw32 +++ b/builds/mingw32/Makefile.mingw32 @@ -1,5 +1,5 @@ CC=gcc -CFLAGS=-Wall -Os -g -DDLL_EXPORT -DFD_SETSIZE=1024 -DZMQ_USE_SELECT -I. +CFLAGS=-Wall -Os -g -DDLL_EXPORT -DFD_SETSIZE=4096 -DZMQ_USE_SELECT -I. LIBS=-lws2_32 OBJS = ctx.o reaper.o dist.o err.o \ diff --git a/builds/msvc/vs2008/libzmq/libzmq.vcproj b/builds/msvc/vs2008/libzmq/libzmq.vcproj index ad98d0e5..471f523d 100644 --- a/builds/msvc/vs2008/libzmq/libzmq.vcproj +++ b/builds/msvc/vs2008/libzmq/libzmq.vcproj @@ -11,7 +11,7 @@ - + @@ -30,7 +30,7 @@ - + @@ -49,7 +49,7 @@ - + @@ -66,7 +66,7 @@ - + @@ -83,7 +83,7 @@ - + diff --git a/builds/msvc/vs2010/libzmq/libzmq.props b/builds/msvc/vs2010/libzmq/libzmq.props index 0337ba38..227ff7dc 100644 --- a/builds/msvc/vs2010/libzmq/libzmq.props +++ b/builds/msvc/vs2010/libzmq/libzmq.props @@ -23,7 +23,7 @@ $(ProjectDir)..\..\;$(ProjectDir)..\..\..\..\include\;%(AdditionalIncludeDirectories) false - _CRT_SECURE_NO_WARNINGS;FD_SETSIZE=1024;ZMQ_USE_SELECT;%(PreprocessorDefinitions) + _CRT_SECURE_NO_WARNINGS;FD_SETSIZE=4096;ZMQ_USE_SELECT;%(PreprocessorDefinitions) ZMQ_HAVE_OPENPGM;%(PreprocessorDefinitions) HAVE_LIBSODIUM;%(PreprocessorDefinitions) HAVE_LIBGSSAPI_KRB5;%(PreprocessorDefinitions) diff --git a/builds/msvc/vs2012/libzmq/libzmq.props b/builds/msvc/vs2012/libzmq/libzmq.props index 0337ba38..227ff7dc 100644 --- a/builds/msvc/vs2012/libzmq/libzmq.props +++ b/builds/msvc/vs2012/libzmq/libzmq.props @@ -23,7 +23,7 @@ $(ProjectDir)..\..\;$(ProjectDir)..\..\..\..\include\;%(AdditionalIncludeDirectories) false - _CRT_SECURE_NO_WARNINGS;FD_SETSIZE=1024;ZMQ_USE_SELECT;%(PreprocessorDefinitions) + _CRT_SECURE_NO_WARNINGS;FD_SETSIZE=4096;ZMQ_USE_SELECT;%(PreprocessorDefinitions) ZMQ_HAVE_OPENPGM;%(PreprocessorDefinitions) HAVE_LIBSODIUM;%(PreprocessorDefinitions) HAVE_LIBGSSAPI_KRB5;%(PreprocessorDefinitions) diff --git a/builds/msvc/vs2013/libzmq/libzmq.props b/builds/msvc/vs2013/libzmq/libzmq.props index 0337ba38..227ff7dc 100644 --- a/builds/msvc/vs2013/libzmq/libzmq.props +++ b/builds/msvc/vs2013/libzmq/libzmq.props @@ -23,7 +23,7 @@ $(ProjectDir)..\..\;$(ProjectDir)..\..\..\..\include\;%(AdditionalIncludeDirectories) false - _CRT_SECURE_NO_WARNINGS;FD_SETSIZE=1024;ZMQ_USE_SELECT;%(PreprocessorDefinitions) + _CRT_SECURE_NO_WARNINGS;FD_SETSIZE=4096;ZMQ_USE_SELECT;%(PreprocessorDefinitions) ZMQ_HAVE_OPENPGM;%(PreprocessorDefinitions) HAVE_LIBSODIUM;%(PreprocessorDefinitions) HAVE_LIBGSSAPI_KRB5;%(PreprocessorDefinitions)