c++ - List active handlers in boost io_service -


While testing the Building Unit for Client / Server systems at work, I went into a problem where my IOS service All activated operators (which I knew) were not being released.

One day after passing the code, I came to the misguided handles which had not been integrated into my client's closure procedures.

My question is: Is there an easy way to list currently active handlers in io_service? If not, why not?

Any insights will be appreciated.

There are some problems:

  • Keeping the book will be expensive, Especially in systems with large number of operations and significant concurrency.
  • Even if you get a list, you do not know that it is up-to-date.

I do not know there are specific reasons for promoting this: ASIO, but these reasons come out to me.

The real problem, the destroyer and the scope is your friend. I find it useful to keep a container for high level items (like socket listeners) and when you want to shut down, out of their scope Exit I think share_ptr is good, but you can use all kinds of variants.

If you have to call a stop () method on everything to stop you, then you are going to forget something to do destructive work.


Comments