Open magni-mar opened 1 year ago
Looking a bit further into this, it seems that the reactor_op would need a cancellation key or some kind of way to support per operation cancellation. Similar to what was did here, https://github.com/chriskohlhoff/asio/commit/6bfcc13e996eb9842bb1c33333c9ca5e0910898f#diff-b4f6761af627b21d4c9ba176b0110d2c4682e913722102bee2500ac366f379f3R56
When the async_initiate is made the completion token has amended cancellation slot with nullptr handler, which would require assignment from the reactor_op similarly as is done in boost asio.
I encountered this error while developing and produced a MVE for simplification purposes below.
The OR awaitable operator waits for one coroutine to finish and when it does it terminates the other one.
When I async_receive on a socket that doesn't contain any information this simply hangs. When the timer finishes the async_receive is not terminated.
Output (using boost asio logging feature):
If it were working correctly the line
would be printed after the timer is canceled.