Boost logo

Boost Users :

Subject: Re: [Boost-users] async_send handler problem
From: Igor R (boost.lists_at_[hidden])
Date: 2013-12-14 17:13:09

>> You can create an explicit thread an invoke io_service::run() there,
>> as you've shown above. No need to inherit thread,
>> boost::thread/std::thread object accepts the thread procedure as a
>> parameter.
>> In general, it's quite hard to tell what the problem is without seeing
>> your code. If you can't make a small self-contained sample that
>> reproduces the issue, try posting your real code.
> Sure ! In fact the existing code is quite complex. It is an existing Qt-based project of mine, in which I currently replace Qt with boost. First will need to extract the relevant parts before I will get back to you.

Anyway, if handlers do not get invoked it usually means that
io_service::run() loop either doesn't run or is eternally blocked by
some other completion handler. The former case can occur, for example,
if io_service runs out work, i.e. run() just exits (note that is you
call io_service::run() when there's no async.operation in progress and
it has no associated io_serivce::work, the io_service runs out of work
The both cases are relatively easy to debug.

Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at