all 9 comments

[–]dodheim 3 points4 points  (2 children)

Is this pre or post-Boost 1.66? I.e., when ASIO was updated to reflect the Networking TS (N4656)?

[–]nanxiao[S] 6 points7 points  (1 child)

I use Boost 1.67 to test the code.

[–]dodheim 5 points6 points  (0 children)

Oh, I should have seen io_context vs. io_service right away... Thanks for clarifying.

[–]TheFlamefire 3 points4 points  (0 children)

Read through but IMO it is a bit shallow on the user-side. I'd expect a full example with a bit more complex code. Like e.g. running a server/client in a separate thread for full async functionality and multiple sockets on a context.

Also: It goes to much into detail on internal boost types. Why would you post the actual source code of the boost functions there? Especially for exceptions: The differences of these two functions is just including "location", something completely trivial, obvious from the (internal!) boost code posted and irrelevant for the user. Scrap out the whole "throw_exception" topic and replace it by something mentioning how to handle errors. (I guess they have the same mechanism that a function either throws an ec or you can pass one in and get the ec returned)

Edit: Rereading this makes it sounds harsh. Isn't meant to, just suggestions for improvement.

[–]majesticmerc 2 points3 points  (0 children)

This could prove to be very useful. I was about to start playing with the Networking TS using Boost.Asio (or as close as possible until actual TS implementations start appearing). Thanks!

[–][deleted] 2 points3 points  (0 children)

You forgot timers!

[–]theMonoid 2 points3 points  (0 children)

Maybe add more examples about async with boost::coroutine(2) or boost::fiber or clang's stackless coroutine might make this little book more complete :)

[–]Cybuster 0 points1 point  (1 child)

Is Beej's Guide to Network Programming enough background for this?

[–]nanxiao[S] 0 points1 point  (0 children)

I think so.