Boost logo

Boost Users :

Subject: Re: [Boost-users] [ASIO] io_service.run() call is not blocking until async_write completes
From: Nick Aschberger (nick.aschberger_at_[hidden])
Date: 2009-02-23 05:03:47




Igor R wrote:
Am I wrong in my interpretation, because I see the user effectively doing:
async_write
async_write
async_write
io_service.run()
async_write
async_write
io_service.run()


The first call to io_service.run() correctly calls my message handler 3
times, for the 3 writes. The second call to io_service.run() I expect to see
the handler called twice, but it is not called at all!
    

io_service.reset() should be called before the second run():
http://www.boost.org/doc/libs/1_38_0/doc/html/boost_asio/reference/io_service/reset.html
Thanks Igor,

I will give it a try.

This doesn't appear to be clear from the tutorials. Is there a better resource for "howto" than the boost site tutorials?

cheers

Nick


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