Boost logo

Boost Users :

Subject: Re: [Boost-users] [asio] deadline_timer callback is not called
From: Igor R (boost.lists_at_[hidden])
Date: 2009-10-14 12:03:52


>
> How could cause this kind of behavior?
>
Another guess: do you call the timer functions (expires_from_now(),
async_wait() ) from the thread that is running io_service or from another
one? That is, who calls ProcessRTPPacket() function? If it's called from
another thread, can you try the following:

// instead of calling expires_from_now(), async_wait() directly...
yourTimer_.get_io_service().post(boost::bind(&WaveStream::setTimer, this));
//...

void setTimer()
{
// Some debug message, to see if the function is called.
...expires_from_now(...);
...async_wait(...);
}

Now see if setTimer is called. If it's not called, you've got some problem
with your io_service - it's not running properly.



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