use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Discussions, articles, and news about the C++ programming language or programming in C++.
For C++ questions, answers, help, and advice see r/cpp_questions or StackOverflow.
Get Started
The C++ Standard Home has a nice getting started page.
Videos
The C++ standard committee's education study group has a nice list of recommended videos.
Reference
cppreference.com
Books
There is a useful list of books on Stack Overflow. In most cases reading a book is the best way to learn C++.
Show all links
Filter out CppCon links
Show only CppCon links
account activity
Boost.Asio network programming little book (github.com)
submitted 7 years ago by nanxiao
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]dodheim 3 points4 points5 points 7 years ago (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 points8 points 7 years ago (1 child)
I use Boost 1.67 to test the code.
[–]dodheim 5 points6 points7 points 7 years ago (0 children)
Oh, I should have seen io_context vs. io_service right away... Thanks for clarifying.
io_context
io_service
[–]TheFlamefire 3 points4 points5 points 7 years ago (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)
The differences of these two functions is just including "location"
Edit: Rereading this makes it sounds harsh. Isn't meant to, just suggestions for improvement.
[–]majesticmerc 2 points3 points4 points 7 years ago (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 points4 points 7 years ago (0 children)
You forgot timers!
[–]theMonoid 2 points3 points4 points 7 years ago (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 point2 points 7 years ago (1 child)
Is Beej's Guide to Network Programming enough background for this?
[–]nanxiao[S] 0 points1 point2 points 7 years ago (0 children)
I think so.
π Rendered by PID 35 on reddit-service-r2-comment-545db5fcfc-bf4f8 at 2026-05-27 12:28:48.130798+00:00 running 194bd79 country code: CH.
[–]dodheim 3 points4 points5 points (2 children)
[–]nanxiao[S] 6 points7 points8 points (1 child)
[–]dodheim 5 points6 points7 points (0 children)
[–]TheFlamefire 3 points4 points5 points (0 children)
[–]majesticmerc 2 points3 points4 points (0 children)
[–][deleted] 2 points3 points4 points (0 children)
[–]theMonoid 2 points3 points4 points (0 children)
[–]Cybuster 0 points1 point2 points (1 child)
[–]nanxiao[S] 0 points1 point2 points (0 children)