Re: [asio-users] Problem with async_write on Linux
Brought to you by:
chris_kohlhoff
From: Simon P. <sim...@vi...> - 2009-01-29 21:21:45
|
On Thursday 29 January 2009 15:33:34 Lothar May wrote: > Sorry if I sound unfriendly, but I somehow feel frustrated that I have > an issue, and all answers I get sound like "why are you doing it this > way?" "why don't you", instead of helping with the issue. Even if you > are offering help with the design, that's very nice, but changing the > design is not an option at this time. Ok, I'll help you even though it looks like what you're trying to do is shooting yourself in the foot. Take a look at the documentation of io_service::reset(): > This function must be called prior to any second or later set of > invocations of the run(), run_one(), poll() or poll_one() functions when a > previous invocation of these functions returned due to the io_service being > stopped or running out of work. This function allows the io_service to > reset any internal state, such as a "stopped" flag. That's exactly your case. The first call to poll() returns "due to the io_service being stopped or running out of work". So the quick fix is calling reset() after poll(). -- Please try Numb, a STUN/TURN server implementation. Free access at http://numb.viagenie.ca/. |