30 May
2013
30 May
'13
7:26 p.m.
Hi Arpan,
Internal handlers, in my humble opinion, should not be something users should be asked to bother with. From their perspective, it should only be their completion handlers that they need to think about. In the code below, the io_service.run_one returns after the call to async_read_until but it is extremely difficult to understand whose handler got executed, mine in application code didn't. async_write() and async_read_until() are just helper functions. If you don't like them, then don't use them. Re-implement your program with socket.async_write_some() and socket.async_read_some(), and you can tightly control which async operations are passed to the io_service.
-Brad