Skip to content

Commit

Permalink
Merge pull request zeromq#30 from madevgeny/master
Browse files Browse the repository at this point in the history
Added parameter to set the max number of sockets.
  • Loading branch information
hintjens committed Mar 3, 2014
2 parents 2358037 + 1b7948c commit b4b7d9f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion zmq.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -254,14 +254,17 @@ namespace zmq
}


inline explicit context_t (int io_threads_)
inline explicit context_t (int io_threads_, int max_sockets_ = 1024)
{
ptr = zmq_ctx_new ();
if (ptr == NULL)
throw error_t ();

int rc = zmq_ctx_set (ptr, ZMQ_IO_THREADS, io_threads_);
ZMQ_ASSERT (rc == 0);

rc = zmq_ctx_set (ptr, ZMQ_MAX_SOCKETS, max_sockets_);
ZMQ_ASSERT (rc == 0);
}

#ifdef ZMQ_HAS_RVALUE_REFS
Expand Down

0 comments on commit b4b7d9f

Please sign in to comment.