2008/12/25 Thomas Steinacher <[email protected]>:
> Hello,
>
> I have a certain device which sends messages via UDP. These messages
> have effect on the stage rendering, which means I need to get them
> periodically. The question is, what's the best way to do this? The
> callback should be triggered between every redraw, i.e. there should
> be no two stage redraws without the callback being called between the
> redraws. Also, if the callback triggers a redraw, it shouldn't be
> called again until the redraw happened. If the callback doesn't
> trigger a redraw, it should be called again "very soon" (= n times per
> second) to check for messages again.

If you're using UDP, then you can ask the glib mainloop to call your callback
whenever there is data available on the socket. In the python bindings you'll
want to use glib.io_add_watch. Then your callback will run whenever new
messages arrive from your device.

Cheers
Grahame
-- 
To unsubscribe send a mail to [email protected]

Reply via email to