Boost logo

Boost Users :

Subject: Re: [Boost-users] ASIO: Writing Composed Operations
From: Cristian Morales Vega (cristian_at_[hidden])
Date: 2018-12-17 22:48:53

On Sat, 15 Dec 2018 at 21:21, Damian Jarek <damian.jarek93_at_[hidden]> wrote:
> As for the echo example in Beast: looks to me like there is a work guard for the I/O executor in state of the echo_op, so it seems to be correct.

What I'm concerned about now is the lack of a work guard for the
Executor associated with the CompletionHandler.

I have modified your example here . It does work without
the second work guard, but not sure why. I'm concerned about the work
count reaching zero in the fourth output line, before the first
"Completion Handler called".
says: "Once the count of unfinished work reaches zero, the io_context
is stopped and the run() and run_one() functions may exit." So ASIO
would have been free to stop ctx2 there, right?

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