Networking in C++ Part #1: MMO Client/Server, ASIO & Framework Basics



In this series, I use ASIO to create a portable, reusable, simple and flexible framework for general purpose client/server applications in C++. This video shows how to setup ASIO, then explores some of the challenges networking presents in general, before outlining the framework and starting to implement the basic components of it. Ultimately this series will yield a simple MMO game.

Source: https://github.com/OneLoneCoder/olcPixelGameEngine/tree/master/Videos/Networking/Parts1%262

Patreon: https://www.patreon.com/javidx9

YouTube: https://www.youtube.com/javidx9
https://www.youtube.com/javidx9extra
Discord: https://discord.gg/WhwHUMV
Twitter: https://www.twitter.com/javidx9
Twitch: https://www.twitch.tv/javidx9
GitHub: https://www.github.com/onelonecoder
Homepage: https://www.onelonecoder.com

42 thoughts on “Networking in C++ Part #1: MMO Client/Server, ASIO & Framework Basics

  1. Now it’s time I actually try this. Dude is so fucking resourceful. Must’ve somehow avoided playing OSRS his whole life. What a codified gangster. Thanks!

  2. This is an excellent video. It has good production quality and pacing. Javidx9 has taken a complex subject and showed the implementation details along with concise explanations for the given choices. Thank You.

  3. You always do something that not any ANY other YouTube programming channel would do. I love that! without you there would probably not be anyone who spends effort into their videos as much as you do. Your the best!

  4. Hi, I have a problem. I want to build on Visual studio 2019 x64 version.
    But Connect Func an error occurs when create a start context thread.
    How can I fix it ?

  5. hey i have a problem with the io_context constructor. my VS2017 says that this wouldn't be a member of the namespace "asio". I'm doing everything as you did and there is even an unsolved thread on stackoverflow to this exact topic. please explain if you can.

  6. Just to be clear, the Asio C++ being used here is not to be confused with the Audio Stream Input/Output (ASIO) card driver protocol for digital audio specified by Steinberg. I was a bit puzzled to begin with.

  7. I love that your video's doin't have distracting music because then I get to add my own distracting music while I continuously rewind your content run on sentence XD

  8. Great Introduction to asio. Sadly writing a thread safe queue is NOT easy. Your front() function is highly dangerous if not dead wrong. You return a reference and release the lock, another thread might call pop_front() and push_front() and you wonder what data you get. Make the reference a copy also for back(). This should help.

  9. Thank you a lot! This stuff is brilliant! The lovest part where you describe the architecture. I will try to apply this way in my work, thank you!

    More architecture 🙂

    Thank you!

  10. 46:50 Would it make sense to emulate all of the std::deque interface? One issue I see is that methods like front() and back() that return references may have the lifetime of that reference not correspond to the code path (e.g. if one thread calls front(), then another thread calls pop_front() -> undefined behavior).

  11. I really appreciate the prep work that went into this video. Specifically I like that you first explore some of the dead ends to help drive home some of the subtleties of asyncronous behavior.

  12. So glad to find an ASIO (or, for me, Boost.Asio) tutorial! I have a rather chaotic self-made framework that I learned as I coded, based on looking at code for reverse engineered MMO server projects.

  13. 9:29 – I got this message error: "undefined reference to `pthread_create'
    collect2: error: ld returned 1 exit status", while i tried to compiling it.

  14. Invaluable video, liked and subscribed. How much work would it be to repurpose this library/framework using UDP instead of TCP? Also, when would you want to use UDP and why? Sorry if you already answer this later in the series.

  15. 10:40 I know. I shudder to think of the alternative though. If they tried to enact an HTTP3 standard today it would probably be based on encrypted protobufs and imagine trying to read THAT as a home user trying to understand why you can't download more cat pictures from the internet…

Leave a Reply

Your email address will not be published. Required fields are marked *