I have one thread how runs io_service.
I have 2 servers (tcp) ports with all corresponded acceptor and bunch of sockets connected to both ports.

I am looking into the way to stop just one server but still run the other one.
I have implemented a "hard" way to stop server:  remove acceptor, cancel/close sockets, that will trigger all read/write asynchronous callbacks, wait till they all done.

but there is a incontinence I need to know how may callbacks still here.

Is there any simpler way to do the same thing?
Something like block the cancel call until all call back done?


Please follow the attached hyperlink to an important disclosure:
http://www.credit-suisse.com/legal/marketcommentary



==============================================================================
Please access the attached hyperlink for an important electronic communications disclaimer:
http://www.credit-suisse.com/legal/en/disclaimer_email_ib.html
==============================================================================