[zeromq-dev] Blocking after 2000 sent messages

Garrett Smith g at rre.tt
Thu Dec 19 02:18:54 CET 2013


Damn, I somehow knew this was going to be a "read the docs" answer:

"Caution: All options, with the exception of ZMQ_SUBSCRIBE,
ZMQ_UNSUBSCRIBE, ZMQ_LINGER, ZMQ_ROUTER_MANDATORY, ZMQ_PROBE_ROUTER,
ZMQ_XPUB_VERBOSE, ZMQ_REQ_CORRELATE, and ZMQ_REQ_RELAXED, only take
effect for subsequent socket bind/connects."

Thanks for your help!

On Wed, Dec 18, 2013 at 6:07 PM, KIU Shueng Chuan <nixchuan at gmail.com> wrote:
> Okay I tried it.
> Set the socket option *before* the bind *and* connect.
>
> Note: I was wrong about having to set *both* sndhwm (of output) and rcvhwm
> (of input) to 0 in order to get infinite hwm behaviour.
> Setting either to 0 is sufficient. The logic is in socket_base.cpp.
>
>
> On Thu, Dec 19, 2013 at 7:09 AM, Garrett Smith <g at rre.tt> wrote:
>>
>> I omitted these details, I actually have this brutally set:
>>
>>     zsocket_set_sndhwm(output, 0);
>>     zsocket_set_rcvhwm(output, 0);
>>     zsocket_set_sndhwm(input, 0);
>>     zsocket_set_rcvhwm(input, 0);
>>
>> The output ends at "2000" (blocking send) - same as when the HWMs aren't
>> set.
>>
>> On Wed, Dec 18, 2013 at 4:03 PM, KIU Shueng Chuan <nixchuan at gmail.com>
>> wrote:
>> > For inproc, the effective hwm is the sum of the send and recv hwm.
>> > Default
>> > of 1000 per side gives 2000.
>> >
>> > To set hwm to unlimited, you would need to set both send and recv hwm to
>> > 0.
>> > You didn't say at which number it blocks after you set only the send hwm
>> > to
>> > 0.
>> >
>> > On Dec 19, 2013 5:20 AM, "Garrett Smith" <g at rre.tt> wrote:
>> >>
>> >> I'm using czmq. This code:
>> >>
>> >>     zctx_t *ctx = zctx_new ();
>> >>
>> >>     void *output = zsocket_new (ctx, ZMQ_PAIR);
>> >>     zsocket_bind (output, "inproc://zstr.test");
>> >>     void *input = zsocket_new (ctx, ZMQ_PAIR);
>> >>     zsocket_connect (input, "inproc://zstr.test");
>> >>
>> >>     int i;
>> >>     for (i = 0; i < 3000; i++) {
>> >>         fprintf (stderr, " %i", i);
>> >>         zstr_send (output, "this is string %d", i);
>> >>     }
>> >>
>> >> will print up to "2000" and then block.
>> >>
>> >> As this behavior is (seems to be) governed by sndhwm - I set it to 0
>> >> to on output disable it:
>> >>
>> >>     zsocket_set_sndhwm (output, 0);
>> >>
>> >> But I'm seeing the same behavior.
>> >>
>> >> I've read The Guide, bought Pieter's book, given presentations on 0MQ
>> >> at conferences and *even* read the API docs. Now I'm trying crowd
>> >> sourcing -- is there an obvious explanation to someone?
>> >>
>> >> Garrett
>> >> _______________________________________________
>> >> zeromq-dev mailing list
>> >> zeromq-dev at lists.zeromq.org
>> >> http://lists.zeromq.org/mailman/listinfo/zeromq-dev
>> >
>> >
>> > _______________________________________________
>> > zeromq-dev mailing list
>> > zeromq-dev at lists.zeromq.org
>> > http://lists.zeromq.org/mailman/listinfo/zeromq-dev
>> >
>> _______________________________________________
>> zeromq-dev mailing list
>> zeromq-dev at lists.zeromq.org
>> http://lists.zeromq.org/mailman/listinfo/zeromq-dev
>
>
>
> _______________________________________________
> zeromq-dev mailing list
> zeromq-dev at lists.zeromq.org
> http://lists.zeromq.org/mailman/listinfo/zeromq-dev
>



More information about the zeromq-dev mailing list