
28 Oct
2009
28 Oct
'09
8:42 p.m.
Dylan Klomparens wrote:
My question is, why does my call to Service.post always fail? I know it is failing because the function that I post never gets called. There is not explicit return code or thrown exception to indicate that there is a problem.
An io_service keeps running as long as it has work to do. You can force an io_service to keep running by attaching a work object. Try adding boost::asio::io_service::work work(Service); just below main, before the call to Service.run(). Cheers, Rutger