Commit ba5fcc95 authored by Pieter Hintjens's avatar Pieter Hintjens

Merge pull request #892 from olafmandel/ZMQ_SOCKET_LIMIT

Rename ZMQ_MAX_SOCKETS_MAX to ZMQ_SOCKET_LIMIT
parents 1e9ea54b e41c8cba
...@@ -31,10 +31,10 @@ ZMQ_MAX_SOCKETS: Get maximum number of sockets ...@@ -31,10 +31,10 @@ ZMQ_MAX_SOCKETS: Get maximum number of sockets
The 'ZMQ_MAX_SOCKETS' argument returns the maximum number of sockets The 'ZMQ_MAX_SOCKETS' argument returns the maximum number of sockets
allowed for this context. allowed for this context.
ZMQ_MAX_SOCKETS_MAX: Get largest configurable number of sockets ZMQ_SOCKET_LIMIT: Get largest configurable number of sockets
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The 'ZMQ_MAX_SOCKETS_MAX' argument returns the largest number of sockets The 'ZMQ_SOCKET_LIMIT' argument returns the largest number of sockets that
that linkzmq:zmq_ctx_set[3] will accept. linkzmq:zmq_ctx_set[3] will accept.
ZMQ_IPV6: Set IPv6 option ZMQ_IPV6: Set IPv6 option
~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~
......
...@@ -36,7 +36,7 @@ ZMQ_MAX_SOCKETS: Set maximum number of sockets ...@@ -36,7 +36,7 @@ ZMQ_MAX_SOCKETS: Set maximum number of sockets
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The 'ZMQ_MAX_SOCKETS' argument sets the maximum number of sockets allowed The 'ZMQ_MAX_SOCKETS' argument sets the maximum number of sockets allowed
on the context. You can query the maximal allowed value with on the context. You can query the maximal allowed value with
linkzmq:zmq_ctx_get[3] using 'option_name' set to 'ZMQ_MAX_SOCKETS_MAX'. linkzmq:zmq_ctx_get[3] using the 'ZMQ_SOCKET_LIMIT' option.
[horizontal] [horizontal]
Default value:: 1024 Default value:: 1024
......
...@@ -178,7 +178,7 @@ ZMQ_EXPORT void zmq_version (int *major, int *minor, int *patch); ...@@ -178,7 +178,7 @@ ZMQ_EXPORT void zmq_version (int *major, int *minor, int *patch);
/* Context options */ /* Context options */
#define ZMQ_IO_THREADS 1 #define ZMQ_IO_THREADS 1
#define ZMQ_MAX_SOCKETS 2 #define ZMQ_MAX_SOCKETS 2
#define ZMQ_MAX_SOCKETS_MAX 3 #define ZMQ_SOCKET_LIMIT 3
/* Default for new contexts */ /* Default for new contexts */
#define ZMQ_IO_THREADS_DFLT 1 #define ZMQ_IO_THREADS_DFLT 1
......
...@@ -205,7 +205,7 @@ int zmq::ctx_t::get (int option_) ...@@ -205,7 +205,7 @@ int zmq::ctx_t::get (int option_)
if (option_ == ZMQ_MAX_SOCKETS) if (option_ == ZMQ_MAX_SOCKETS)
rc = max_sockets; rc = max_sockets;
else else
if (option_ == ZMQ_MAX_SOCKETS_MAX) if (option_ == ZMQ_SOCKET_LIMIT)
rc = clipped_maxsocket (std::numeric_limits<int>::max()); rc = clipped_maxsocket (std::numeric_limits<int>::max());
else else
if (option_ == ZMQ_IO_THREADS) if (option_ == ZMQ_IO_THREADS)
......
...@@ -31,10 +31,10 @@ int main (void) ...@@ -31,10 +31,10 @@ int main (void)
assert (zmq_ctx_get (ctx, ZMQ_MAX_SOCKETS) == ZMQ_MAX_SOCKETS_DFLT); assert (zmq_ctx_get (ctx, ZMQ_MAX_SOCKETS) == ZMQ_MAX_SOCKETS_DFLT);
#if defined(ZMQ_USE_SELECT) #if defined(ZMQ_USE_SELECT)
assert (zmq_ctx_get (ctx, ZMQ_MAX_SOCKETS_MAX) == ZMQ_MAX_SOCKETS_DFLT); assert (zmq_ctx_get (ctx, ZMQ_SOCKET_LIMIT) == ZMQ_MAX_SOCKETS_DFLT);
#elif defined(ZMQ_USE_POLL) || defined(ZMQ_USE_EPOLL) \ #elif defined(ZMQ_USE_POLL) || defined(ZMQ_USE_EPOLL) \
|| defined(ZMQ_USE_DEVPOLL) || defined(ZMQ_USE_KQUEUE) || defined(ZMQ_USE_DEVPOLL) || defined(ZMQ_USE_KQUEUE)
assert (zmq_ctx_get (ctx, ZMQ_MAX_SOCKETS_MAX) assert (zmq_ctx_get (ctx, ZMQ_SOCKET_LIMIT)
== std::numeric_limits<int>::max()); == std::numeric_limits<int>::max());
#endif #endif
assert (zmq_ctx_get (ctx, ZMQ_IO_THREADS) == ZMQ_IO_THREADS_DFLT); assert (zmq_ctx_get (ctx, ZMQ_IO_THREADS) == ZMQ_IO_THREADS_DFLT);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment