[zeromq-dev] Working with the buffering in ZMQ

Leon Palafox leonoel49 at gmail.com
Sat Aug 24 00:15:16 CEST 2013


Hello everyone,

We need your help to clear something a bit.

We are reading messages from a Kinect that is broadcasting in ZMQ.

We use more or less the following code:

socket_t subscriber_eeg(context, ZMQ_SUB);
subscriber_eeg.connect("tcp://127.0.0.1:5559");while(true){Do Random
stuffif (pressedPause){
    //shows message
    continue;}

subscriber.recv(&kinect_msg);//code to process message//code to plot
the hand movements.}

The objective is to pause the execution of the code on the given event that
someone pressed pause. The pause event is running on a thread independently.

Everything works fine, but the problem is that, since ZMQ buffers the
messages, it suddenly starts plotting every movement that is captured in
the paused state.

Is there a way to tell ZMQ to stop receiving the message in the event of
the pause, or to clear the buffer?
Thanks
-- 
Leon Palafox, PhD
Postdoctoral Fellow
UCLA, David Geffen, School of Medicine
Los Angeles, California
U.S.A
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20130823/ee711b0d/attachment.htm>


More information about the zeromq-dev mailing list