mirror of
https://github.com/zeromq/cppzmq.git
synced 2025-01-06 00:31:14 +01:00
Merge pull request #30 from madevgeny/master
Added parameter to set the max number of sockets.
This commit is contained in:
commit
b4b7d9f64f
5
zmq.hpp
5
zmq.hpp
@ -254,7 +254,7 @@ namespace zmq
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
inline explicit context_t (int io_threads_)
|
inline explicit context_t (int io_threads_, int max_sockets_ = 1024)
|
||||||
{
|
{
|
||||||
ptr = zmq_ctx_new ();
|
ptr = zmq_ctx_new ();
|
||||||
if (ptr == NULL)
|
if (ptr == NULL)
|
||||||
@ -262,6 +262,9 @@ namespace zmq
|
|||||||
|
|
||||||
int rc = zmq_ctx_set (ptr, ZMQ_IO_THREADS, io_threads_);
|
int rc = zmq_ctx_set (ptr, ZMQ_IO_THREADS, io_threads_);
|
||||||
ZMQ_ASSERT (rc == 0);
|
ZMQ_ASSERT (rc == 0);
|
||||||
|
|
||||||
|
rc = zmq_ctx_set (ptr, ZMQ_MAX_SOCKETS, max_sockets_);
|
||||||
|
ZMQ_ASSERT (rc == 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef ZMQ_HAS_RVALUE_REFS
|
#ifdef ZMQ_HAS_RVALUE_REFS
|
||||||
|
Loading…
Reference in New Issue
Block a user