Hello Leon,
Call recv() in paused state also, but do not actually process the message.
That way you won't accumulate irrelevant messages.
On Aug 25, 2013 12:38 AM, "Leon Palafox" <[email protected]> wrote:
> 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
>
>
> _______________________________________________
> 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