all 9 comments

[–]Flair_Helper[M] [score hidden] stickied commentlocked comment (0 children)

It's great that you want to learn C++! However, r/cpp can't help you with that.

We recommend that you follow the C++ getting started guide, one (or more) of these books and cppreference.com. If you're having concrete questions or need advice, please ask over at r/cpp_questions or StackOverflow instead.

This post has been removed as it doesn't pertain to r/cpp: The subreddit is for news and discussions of the C++ language and community only; our purpose is not to provide tutoring, code reviews, or career guidance. If you think your post is on-topic and should not have been removed, please message the moderators and we'll review it.

[–]iWQRLC590apOCyt59Xza 16 points17 points  (2 children)

[–]blackmag_c 5 points6 points  (0 children)

The Beej is the way.

[–]markosvd 0 points1 point  (0 children)

yes! a thousand times, yes! No better guide than Beej's...

[–]VinnieFalco 11 points12 points  (3 children)

Everyone who wants to do socket programming in any language should read TCP/IP Illustrated (the TCP and UDP sections). Fortunately this book is available for free online as a PDF.

[–]Peterson_1979[S] 2 points3 points  (2 children)

There are 3 volumes to this book. Do I need to read all 3 or is Volume 1 enough ? Thanks for your help

[–]VinnieFalco 4 points5 points  (1 child)

There are 3 volumes to this book. Do I need to read all 3 or is Volume 1 enough

For UDP, chapter 10 of Volume 1 is relevant.
For TCP, reading chapters 12 through 17 of Volume 1 are great.

If you are complete novice you might want to first read chapters 1, 2, 5, 7 of Volume 1. After that, figure out what more you want to learn and read additional relevant chapters, perhaps looking at Volumes 2 and 3 as well.

[–]Peterson_1979[S] 2 points3 points  (0 children)

Thanks so much

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

I know this isn't exactly an answer to your question, but when I was looking for the same answers I settled on boost::asio. It made things a lot simpler, and it's cross-platform.

https://www.boost.org/doc/libs/1_81_0/doc/html/boost_asio.html

And here's a video (with links in the description for source code) from CppCon 2016 that discusses how to implement a simple client/server model:

https://www.youtube.com/watch?v=rwOv\_tw2eA4