19 ms·
Please be fair if in the readme that a comparison to ASIO is a bit apples to oranges. This one seems to be mostly a learning project, and is heavily work in pro
by Matthias247 9y ago
Please be fair if in the readme that a comparison to ASIO is a bit apples to oranges. This one seems to be mostly a learning project, and is heavily work in progress.
boost asio already works with boost coroutines in a reasonable fashion. And this would certainly be a good way if someone wants to build some production project on top of it.
Regarding the code and example itself:
Having a separate callback for connection close seems to be a bit backward, since it again means the connection state is spread out over multiple callbacks. The purpose of a coroutine is to have everything in scope of that routine. In that case the connection close should be signaled by reading 0 from the socket, or the read returning an error.
- matt42 9y agoRemoved the comparison with ASIO. But note that this is not "heavily in progress" but ready for production too. I took your remark for the closing callback. read now returns 0 and write returns false when the connection is closed or lost.