summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Sustrik <sustrik@250bpm.com>2011-02-08 16:19:37 +0100
committerMartin Sustrik <sustrik@250bpm.com>2011-02-08 16:19:37 +0100
commit889424e675eecd9d9c7d1121456401d5c43029a5 (patch)
tree1c5cf4f9c50db9720c69e163f0831d0d554f971f
parent5dcbc34396bb4d256916fafcbb2ddd646ad179e6 (diff)
max_sockets honoured precisely
The internal log socket was subtracted from the number of available sockets. So, if max_sockets was set to 100, you could create only 99 sockets. Fixed. Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
-rw-r--r--src/ctx.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/ctx.cpp b/src/ctx.cpp
index 858d91e..91b0236 100644
--- a/src/ctx.cpp
+++ b/src/ctx.cpp
@@ -49,8 +49,8 @@ zmq::ctx_t::ctx_t (uint32_t io_threads_) :
HIBYTE (wsa_data.wVersion) == 2);
#endif
- // Initialise the array of mailboxes.
- slot_count = max_sockets + io_threads_;
+ // Initialise the array of mailboxes. +1 accounts for internal log socket.
+ slot_count = max_sockets + io_threads_ + 1;
slots = (mailbox_t**) malloc (sizeof (mailbox_t*) * slot_count);
zmq_assert (slots);