Boost logo

Boost Users :

Subject: Re: [Boost-users] Custom services using boost::asio
From: Marat Abrarov (abrarov_at_[hidden])
Date: 2011-08-16 15:05:42


Hi, Allan.

> The Io part is easy to fit into asio, but I'm having problems seeing what
> the best way is to implement the core application event processing.
>
> Using glib::source I could register an interface where two function is
> called:
>
> bool prepare (int &timeout);
> bool dispatch (sigc::slot_base *slot);
>
> Prepare could set a time out identifying how much time should elapse before
> dispatch is ready to process an event.
>
> When the time is passed, the glib main loop will call the dispatch function,
> where I then can process the internal events.
>
> How can this be implemented in boost::asio io_service?

May be boost::asio::deadline_timer can help you?
http://www.boost.org/doc/libs/1_47_0/doc/html/boost_asio/overview/timers.html
http://www.boost.org/doc/libs/1_47_0/doc/html/boost_asio/tutorial/tuttimer2.html
http://www.boost.org/doc/libs/1_47_0/doc/html/boost_asio/reference/deadline_timer.html

Regards,
Marat Abrarov.


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net