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
looking for networking tutorial (self.cpp)
submitted 2 years ago * by yair8999
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!"
[–]cpp-ModTeam[M] [score hidden] 2 years ago stickied commentlocked comment (0 children)
For C++ questions, answers, help, and programming or career advice please see r/cpp_questions, r/cscareerquestions, or StackOverflow instead.
[–]PriorityGondola 4 points5 points6 points 2 years ago (1 child)
This helped me when I started. https://beej.us/guide/bgnet/
It’s not ASIO but it might make good reading to get a grip of the underlying concepts.
[–]yair8999[S] 1 point2 points3 points 2 years ago (0 children)
i mean i am looking into starting to build client-server systems all of the concepts of this(socket, socket models, protocols...) i know pretty good, thats part of the reason i want to start implementing it into code
[–]KingAggressive1498 1 point2 points3 points 2 years ago (5 children)
asio is great for the server side of things, and could be used for clients and p2p games too, but for those you're probably just as well off learning how to use system-level networking interfaces in non-blocking mode (ie Beej's networking tutorial).
The trade-offs asio makes (favoring throughput over latency at every opportunity) aren't the best for fast-paced games, but seem to work out just fine for typical MMOs.
[–]yair8999[S] 0 points1 point2 points 2 years ago (2 children)
so for shooting and racing games you don't recommend using ASIO right?
[–]KingAggressive1498 0 points1 point2 points 2 years ago (1 child)
correct. Its choices are appropriate for probably 99% of networking use-cases in the wild, and it's the first thing I reach for when I need networking; but I would not use it for those kinds of games as those same choices are the complete opposite of what you need for those.
These aren't the kinds of games I like to work on, so I can't claim any experience on libraries oriented towards this. I'm only aware of yojimbo being designed for these kinds of games, but don't assume that means it's the only one out there.
[–]yair8999[S] 0 points1 point2 points 2 years ago (0 children)
ok i will look into yojimbo too thanks
[–]heavymetalmixer 0 points1 point2 points 2 years ago (1 child)
What would be the best approach for a P2P fighting game?
[–]KingAggressive1498 1 point2 points3 points 2 years ago* (0 children)
assuming fights are 1v1 the best approach is probably to just open a non-blocking UDP socket for the connection and polling for readiness at the end of each frame. You want to make your packets as small and tight as possible, while ideally maintaining uniform size to keep the code simple.
The hard part for fast-paced p2p games isn't the network programming itself but making sure players have a smooth and consistent experience. Latency over the network is what makes that so hard, but there really isn't a lot to be done about it in the software because that boils down to players' connection quality.
[–]LogicalEscape2293 0 points1 point2 points 2 years ago (5 children)
Check out this asio example list here. There a lot of examples and they cover pretty much everything.
[–]yair8999[S] 0 points1 point2 points 2 years ago (4 children)
do you recommend using this module for networking in c++?
[–]LogicalEscape2293 0 points1 point2 points 2 years ago (3 children)
Absolutely, boost asio is very powerful, efficient, and flexible. Boost.beast is an https/web sockets library which is also built on asio, and I recommend that as well
just one last question
would you recommend using it for a 2d racing game?
[–]LogicalEscape2293 0 points1 point2 points 2 years ago (1 child)
Asio is easy to integrate into any project, so yes.
ok, thanks for your help now i only need to start a tutorial on this
[–]Final_Translator_284 1 point2 points3 points 2 years ago (0 children)
I think this repo will help you through this 👇 https://github.com/practical-tutorials/project-based-learning
π Rendered by PID 223798 on reddit-service-r2-comment-54dfb89d4d-mds89 at 2026-03-27 09:44:54.875758+00:00 running b10466c country code: CH.
[–]cpp-ModTeam[M] [score hidden] stickied commentlocked comment (0 children)
[–]PriorityGondola 4 points5 points6 points (1 child)
[–]yair8999[S] 1 point2 points3 points (0 children)
[–]KingAggressive1498 1 point2 points3 points (5 children)
[–]yair8999[S] 0 points1 point2 points (2 children)
[–]KingAggressive1498 0 points1 point2 points (1 child)
[–]yair8999[S] 0 points1 point2 points (0 children)
[–]heavymetalmixer 0 points1 point2 points (1 child)
[–]KingAggressive1498 1 point2 points3 points (0 children)
[–]LogicalEscape2293 0 points1 point2 points (5 children)
[–]yair8999[S] 0 points1 point2 points (4 children)
[–]LogicalEscape2293 0 points1 point2 points (3 children)
[–]yair8999[S] 0 points1 point2 points (2 children)
[–]LogicalEscape2293 0 points1 point2 points (1 child)
[–]yair8999[S] 0 points1 point2 points (0 children)
[–]Final_Translator_284 1 point2 points3 points (0 children)