zeromq/libzmq — pull request #889 by olafmandel (2014-02-13 15:32:08+00:00)
Title: Add ZMQ_MAX_SOCKETS_MAX to zmq_ctx_get()

When calling zmq_ctx_set(ZMQ_MAX_SOCKETS) it is not clear what the range of allowed socket numbers is. This can be either tested (try different socket numbers until the call succeeds) or one can use the knowledge that only select_t has a limited number of sockets and that that is only used under Windows. But this approach seems cleaner to me:

The new options allows querying the maximum allowed number of sockets. This is system dependent and cannot be encoded in the include file as a preprocessor macro: for ZMQ_USE_SELECT, this depends on the FD_SETSIZE macro at time of library compilation, not at time of include file use.