[zeromq-dev] Working with the buffering in ZMQ
Daniel Krikun
krikun.daniel at gmail.com
Sun Aug 25 08:10:18 CEST 2013
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" <leonoel49 at gmail.com> 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
> zeromq-dev at lists.zeromq.org
> http://lists.zeromq.org/mailman/listinfo/zeromq-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20130825/a2ce235b/attachment.htm>
More information about the zeromq-dev
mailing list