Merge pull request #1090 from hintjens/master

Problem: zmq_ctx_get (ZMQ_MAX_SOCKETS) returns gibberish
This commit is contained in:
Richard Newton 2014-06-16 08:45:37 +01:00
commit 1d236d81c8
2 changed files with 2 additions and 3 deletions

View File

@ -208,7 +208,7 @@ int zmq::ctx_t::get (int option_)
rc = max_sockets;
else
if (option_ == ZMQ_SOCKET_LIMIT)
rc = clipped_maxsocket (std::numeric_limits<int>::max());
rc = clipped_maxsocket (65535);
else
if (option_ == ZMQ_IO_THREADS)
rc = io_thread_count;

View File

@ -34,8 +34,7 @@ int main (void)
assert (zmq_ctx_get (ctx, ZMQ_SOCKET_LIMIT) == ZMQ_MAX_SOCKETS_DFLT);
#elif defined(ZMQ_USE_POLL) || defined(ZMQ_USE_EPOLL) \
|| defined(ZMQ_USE_DEVPOLL) || defined(ZMQ_USE_KQUEUE)
assert (zmq_ctx_get (ctx, ZMQ_SOCKET_LIMIT)
== std::numeric_limits<int>::max());
assert (zmq_ctx_get (ctx, ZMQ_SOCKET_LIMIT) == 65535);
#endif
assert (zmq_ctx_get (ctx, ZMQ_IO_THREADS) == ZMQ_IO_THREADS_DFLT);
assert (zmq_ctx_get (ctx, ZMQ_IPV6) == 0);