[zeromq-dev] [PATCH] FD_SETSIZE increased for win32
Martin Sustrik
sustrik at 250bpm.com
Thu Nov 4 11:11:39 CET 2010
On 11/03/2010 12:21 PM, Pieter Hintjens wrote:
> On Wed, Nov 3, 2010 at 12:16 PM, Pieter Hintjens<ph at imatix.com> wrote:
>
>> https://github.com/zeromq/zeromq2/issues#issue/57
>>
>> Note that this will not take effect until inclusion of winsock2.h is
>> removed from zmq.h, for which I'll raise a separate issue.
>
> Actually, on consideration the use of winsock2. in zmq.h doesn't have
> any relation to this fix. The core zmq classes will happily now work
> with up to 1024 sockets on Windows. However any application including
> zmq.h will find itself getting FD_SETSIZE set to 64.
Right.
Additionally, I would suggest using a following simpler patch:
index 78d3afd..663d5d7 100644
--- a/src/select.cpp
+++ b/src/select.cpp
@@ -23,6 +23,7 @@
#include <algorithm>
#ifdef ZMQ_HAVE_WINDOWS
+#define FD_SETSIZE 1024
#include "winsock2.h"
#elif defined ZMQ_HAVE_HPUX
#include <sys/param.h>
The rationale is that this way the FD_SETSIZE setting is restricted to
select.cpp compilation unit and there's no way it can possibly break any
of the existing functionality.
Martin
More information about the zeromq-dev
mailing list