When I set HWM before the bind() call, it works! So, either make it work after the bind() call or modify the ZGUIDE example.
On Thu, Jul 28, 2011 at 8:33 AM, Tonis Xie <[email protected]> wrote: > After the bind() call, as below: > > ... > // Subscriber tells us when it's ready here > void *sync = zmq_socket (context, ZMQ_PULL); > zmq_bind (sync, "tcp://*:5564"); > > // We send updates via this socket > void *publisher = zmq_socket (context, ZMQ_PUB); > zmq_bind (publisher, "tcp://*:5565"); > > // Prevent publisher overflow from slow subscribers > uint64_t hwm = 5; > zmq_setsockopt (publisher, ZMQ_HWM, &hwm, sizeof (hwm)); > > // Specify swap space in bytes, this covers all subscribers > //uint64_t swap = 25000000; > //zmq_setsockopt (publisher, ZMQ_SWAP, &swap, sizeof (swap)); > > // Wait for synchronization request > char *string = s_recv (sync); > free (string); > ... > > On Wed, Jul 27, 2011 at 7:12 PM, Ian Barber <[email protected]> wrote: > >> On Wed, Jul 27, 2011 at 12:03 PM, Tonis Xie <[email protected]> wrote: >> >>> I changed the "sleep(1)" in durapub2.c to "usleep(10)", make the loop run >>> infinitely, start durapub2 and durasub, ctrl-c durasub, and I am seeing that >>> the allocated memory of durapub2 keep raising just like never hitting a >>> limit at all! However, I set the HWM to only 5. >>> >> >> Just to check with the changes, is the call to setsockopt with the HWM >> made before the bind() call, or after? >> >> Ian >> >> _______________________________________________ >> zeromq-dev mailing list >> [email protected] >> http://lists.zeromq.org/mailman/listinfo/zeromq-dev >> >> >
_______________________________________________ zeromq-dev mailing list [email protected] http://lists.zeromq.org/mailman/listinfo/zeromq-dev
