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

Поделиться
HTML-код
  • Опубликовано: 14 окт 2024

Комментарии • 929

  • @javidx9
    @javidx9  4 года назад +172

    For all those unconvinced it can work, please download and try the prototype project here! onelonecoder.itch.io/meaningless-cog

    • @Zaneris
      @Zaneris 4 года назад +18

      Decided to provide some tea for this quality content ;) Keep up the good work.

    • @javidx9
      @javidx9  4 года назад +10

      Thank you Zaneris! Much appreciated!

    • @javidx9
      @javidx9  4 года назад +16

      Yeah asio comes with ssl objects you can use to negotiate https. A bit too complex for a simple introduction 😁

    • @Ryan-xq3kl
      @Ryan-xq3kl 4 года назад

      Ive always been interested in building a mmo project over a long period of time. Is it possible to use this method for high concurrency on a 3D client?

    • @huberthancock2661
      @huberthancock2661 4 года назад +1

      thanks for all the work you do! as someone learning c++, you are truly helpful thank you

  • @comment1652
    @comment1652 4 года назад +806

    I have no idea what i'm watching, but thank you bearded man for the knowledge.

    • @javidx9
      @javidx9  4 года назад +177

      Best comment ever XD

    • @mattmurphy1065
      @mattmurphy1065 3 года назад +13

      I work in IT, and the only thing I understood was the networking lol

    • @soundbreaker2485
      @soundbreaker2485 3 года назад +1

      HTTPS changed the strings being sent in plain text though

    • @williamgomez6087
      @williamgomez6087 3 года назад +1

      You have to see "Hands on Machine Learning whit python"...

    • @devhonk1722
      @devhonk1722 3 года назад

      @@LockeIProd and that does not count from 1 lmao

  • @filmcase1683
    @filmcase1683 4 года назад +587

    This man will always be the person I go to for difficult c++ programs

    • @superscatboy
      @superscatboy 4 года назад +25

      It's a real shame he refuses to use modern C++ idioms and techniques.

    • @qx-jd9mh
      @qx-jd9mh 4 года назад +8

      @@superscatboy Cniles are set in their ways

    • @superscatboy
      @superscatboy 4 года назад +4

      @@qx-jd9mh True. I've never understood why though, it's not exactly hard to keep up with the evolution of the language - it progresses at a glacial rate after all.

    • @qx-jd9mh
      @qx-jd9mh 4 года назад +19

      @@superscatboy Imagine not using RAII, smart pointers, l/r values/move semantics, lambdas, auto/delctype, default/deleted functions, initializer lists, strongly typed enums, static assertions, constexpr, or variadic templates/folding expressions. You had plenty of time to learn OO design patterns with C++03 and before. I guess people who learned systems programming with C don't want to learn higher level abstractions.

    • @swapode
      @swapode 4 года назад +24

      ​@@superscatboy Well, the best modern C++ idiom in most cases probably is to ditch it for Rust ;-)

  • @motbus3
    @motbus3 4 года назад +101

    Stop and realize for one moment how great the content OLC has been posting. Really amazing.

  • @DidYouCropThat
    @DidYouCropThat 4 года назад +64

    I'm a web developer, but always love to see the other side of programming and especially channels that produce advanced materials, not always the "Hello, world" examples.
    Thank you for doing this.

    • @caareystore5058
      @caareystore5058 2 года назад +2

      this video is explanation of how web works under the hood.

  • @Spawnova
    @Spawnova 3 года назад +88

    For anyone else who's zip file did not match his, he made a small mistake at 3:04 and seemed to imply to download the boost_asio file, but in fact you want the non boost file.

    • @crazypeter113
      @crazypeter113 3 года назад +1

      still how can i make my vs work with that?

    • @welcomereality924
      @welcomereality924 3 года назад

      @@crazypeter113 check the properties files vscode creates, there must be some sort of parameter for includes iirc

    • @sketburd9360
      @sketburd9360 3 года назад

      this ^^^

    • @The_Nelliel
      @The_Nelliel 3 года назад +1

      Thank you, omg lol I was getting pissed lol

    • @ajaydalal199
      @ajaydalal199 Год назад

      thanks bro, you saved me a lot of time and headache.

  • @YariRu
    @YariRu 2 года назад +4

    I watched a lot of teaching videos in my life. Really a lot. But this one, it's the best of all. I like the language, intonation, and speaker's face, all of it brings live to the whole video. I'm impressed.

  • @RoryBecker
    @RoryBecker Год назад +5

    Everything on this channel is Gold. If I'm not interested in it right now, I'm certain I will be at some point.
    Great content... Delivered well... With just the right level of detail... at the perfect pace.

  • @NoxaDreshar
    @NoxaDreshar 3 года назад +9

    Coder with 10 years of experience here but in other languages such as C# etc. Learning about C++ now and I gotta say your videos are on a very high technical level and you go through them step by step which I really appreciate. Great quality stuff, keep going. Also highly respect your professional skill level - it kinda makes me feel like a dumbass xD

  • @HitAndMissLab
    @HitAndMissLab 4 года назад +8

    Thank you for the phenomenal video! + Thank you for not assuming that viewers already know what you know + Thank you for explaining things slowly, one small step at a time. That's the best method.

    • @javidx9
      @javidx9  4 года назад +1

      Hey thanks buddy! It's a formula that works.

  • @mattbrewerton6884
    @mattbrewerton6884 3 года назад +27

    I can't keep away from these videos. I've watched and listened to so many of them.
    I don't use C++.

    • @robrick9361
      @robrick9361 3 месяца назад +1

      C++ is for people who like to find problems for their solutions.

  • @MarcoBergamin
    @MarcoBergamin 4 года назад +33

    Really great video!
    Some suggestions/notes:
    In net_message.h
    - use is_trivially_copiable instead of is_standard_layout to check if a datatype can be safely "memcopied"
    In net_tsqueue.h
    - make muxQueue mutable add the 'const' keyword to the methods where applicable.
    - fix push_front and push_back because you are moving a const T& which can't be moved (maybe add push_front(T&&) and push_back(&&) methods for this)
    - (just to increase the portability) use std::lock_guard instead of std::scoped_lock
    In net_connection.h
    - when deriving from std::enable_shared_from_this it is best practice to make the ctor private and add a factory method to create an shared_ptr of that class to be sure you can always call the method shared_from_this without having undefined behaviour or an exception, depending on the c++ version
    In general, I have noticed you always declare the destructor; be aware that when you declare the dtor, the move ctor and move assignment operator are deleted by default and you have to define them again so maybe defining them again could be a good idea.

  • @ppb2374
    @ppb2374 14 дней назад +1

    讲得真好,谢谢老师!以前复制示例,一知半解,也能用,今天听了老师的讲解豁然开朗!

  • @trobinsoon
    @trobinsoon 3 года назад +8

    It took me a while to work it out so for those of you with an error that looks something like "undefined reference to `pthread_join`" (I'm on linux by the way).
    I fixed it by using - pthread in the compiling command:
    g++ Main.cpp -I [insert include directory] -o Main -pthread
    Hope this helps (:

  • @bobarnoldjr.1937
    @bobarnoldjr.1937 4 года назад +3

    javidx9 - thanks so much for your videos. I haven't done C/C++ since college 20 years ago. You've definitely re-sparked my interest in C. It was fun putting together a working example of the message buffer from your video. I got started writing games in my teens back in the early 90s but have done business software in my professional career. In college over a Christmas break I recall writing a centipede clone in java. Great stuff! Much appreciated!

  • @kamerkrali5214
    @kamerkrali5214 2 года назад +1

    I had a passion for software since I was a kid, but it was very small for what was sold at that time. It was difficult to find information in Turkish. After asking, I realized that even English was scarce on the internet at that time. Thank you for giving a lot of simple graphic emulators now.

  • @bongumsamamba5146
    @bongumsamamba5146 4 года назад +21

    this dude makes everything looks simple

  • @jake3476
    @jake3476 2 года назад +1

    A lot of mental effort was clearly put into making this video as informative as it could be. Thank you for your hard work.

  • @ahaquer153
    @ahaquer153 4 года назад +166

    I don't think I've ever clicked on a video faster

    • @filmcase1683
      @filmcase1683 4 года назад +2

      I know, right?

    • @pwnrz8684
      @pwnrz8684 4 года назад

      @@filmcase1683 MAIAMAIAMIAMAIAMIAMAIMAIMAIAMIAMAIMA

    • @TheDubleyaC
      @TheDubleyaC 4 года назад +2

      For real, I don't think I'd be interested in any other channel posting a video with this title/description. However, here it's a 100% must watch.

    • @bruno_kid_
      @bruno_kid_ 4 года назад +1

      [2]

    • @johnbrodie9815
      @johnbrodie9815 4 года назад +1

      same my dude

  • @richardvonlehe4581
    @richardvonlehe4581 3 года назад +1

    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.

  • @persoulrpg
    @persoulrpg 4 года назад +27

    Golden content, yet it's free. Appreciate it people :-)

  • @smoothoctopus
    @smoothoctopus 7 месяцев назад +2

    The first 20 minutes are beyond gold, bearded man.

  • @SourceCodeDeleted
    @SourceCodeDeleted 4 года назад +28

    I am really interested to see this !!! Much needed !!!

    • @Zaneris
      @Zaneris 4 года назад

      Socket/networking tutorials are horrible for the most part with addressing how you should design it for real world applications. So happy this is being covered.

    • @stewartzayat7526
      @stewartzayat7526 4 года назад +1

      Your user name gives me anxiety

    • @SourceCodeDeleted
      @SourceCodeDeleted 4 года назад

      @@stewartzayat7526 Not the first time I have heard this))

    • @deleater
      @deleater 3 года назад +1

      @@SourceCodeDeleted you make me want to create another account named "Executable Reverse Engineered" lol.

  • @tsunamio7750
    @tsunamio7750 2 года назад

    I love how you make your code ultra-wide and readable for most viewers.
    Teachers can use it in school.
    I can see it from 5m away, cozy in my bed!

  • @juappdev
    @juappdev 4 года назад +4

    A short while back I reverse engineered an MMO protocol, implementing a replacement server using ASIO. Ended up making heavy use of strands and IO services in order to handle most of the basic queuing. ASIO comes in pretty handy for writing performant servers!
    Prob my greatest frustration however was it's extremely difficult to find a good database library which works well with ASIOs async paradigm, so I ended up just using a threaded connection pool for the actual db queries. Will be interesting to see how you tackle that (if you are using a database in the backend).
    I also felt that it was lacking a bit when it came to actually handling packet data - you've often got to keep track of a lot of state to properly handle rate limiting, writing out packet data, handling bad packets, authentication, and so on. But then again in the long run, probably best to handle that yourself.

    • @Xenonterminus5
      @Xenonterminus5 3 года назад

      Was the mmo protocol for wow? Watching this vid because I've been working on a wow emu recently and I really want to understand the underlying networking going into it. For some reason, mmo networking is fascinating.

  • @HupLOader561
    @HupLOader561 3 года назад +2

    You always do something that not any ANY other RUclips 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!

  • @doublegdog
    @doublegdog 4 года назад +7

    love this youtube channel. I am a programmer but am not familiar with C++. You do such a great job explaining concepts for newer programmers! Keep it up!

    • @javidx9
      @javidx9  4 года назад +1

      Glad you enjoy it doublegdog!

  • @secretchannel2151
    @secretchannel2151 4 года назад

    Nowadays as i grow older im getting more interested in how the worlds that hooked me as a child were developed, specifically MMOS. I hope to take the time to analyze this video deeply in the future. Thanks for the video sir!

  • @wizardy6267
    @wizardy6267 4 года назад +3

    Thanks for the video, lots of useful stuff. One minor thing @ 55:04, m_connection.release() is used here. The release has a return value to return a raw pointer from the unique pointer which is not really used here. Maybe the reset() is good enough for destroying the connection? And I think the video is missing few seconds about adding Send() interface into client_interface.

  • @sergeiborodin9254
    @sergeiborodin9254 4 года назад +1

    The absence of comprehensive ASIO tutorials (I have seen only one good personal blog about using ASIO in C++) makes this tutorial a solid gold bar in the world of C++. Though I've used ASIO to build my own library in very similar fashion to yours - the learning threshold is very high even to professional programmers - I made many babysteps in a very long time to actually implement basic functionality. I had many thread running the context. I used JSON (nlohmann-json) as message payload to pass callable tied async function to ASIO context and get std::future as result. So it was basically a RPC library. Get message -> parse JSON -> find tied function in hash-table -> move function to asio context -> get future -> use future in needed thread. Looks simple but it took weeks of studying and I am very far from from C++ beginner.
    So you have my respect, sir. You did many people a great service for tearing apart and vivisecting this complex subject.

    • @javidx9
      @javidx9  4 года назад

      Thanks Sergei, yeah the documentation for asio is a bit sparse, and oddly dense at the same time. Hopefully that will improve in the near future. Its a monstrously powerful library, I'll barely scratch the surface in this series.

    • @sergeiborodin9254
      @sergeiborodin9254 4 года назад

      @@javidx9 Yes, asio documentation helps a lot if you know where to look. And fails miserably to provide usage meta. Asio is absolutely merciless to newcomers.

  • @bruno_kid_
    @bruno_kid_ 4 года назад +4

    thanks a lot for sharing this content. Info like this is very ward to find, and the majorit times people discourage another developers to do this because it is "hard" or saying "you will never gona do this in you entirely life, do only platform games, cya"

  • @wowLinh
    @wowLinh 4 года назад +1

    Once again you managed to amaze me. At the beginnig I thought you were going to show and explain some standard socket programming, and have in the end the typical mini-chat server and client program. However I was completely wrong, and I am glad. I did not know of ASIO at all, and I simply loved your net implementation. Of course, your explanations pure gold. Very clear. Probably the best channel I am subscribed to. Congratulations once again.

    • @javidx9
      @javidx9  4 года назад

      Hi wowLinh - yeah, i really want to avoid the traditional means of describing this architecture, its just boring :D

  • @sterdot
    @sterdot 4 года назад +103

    Coming from a music production background, I was very confused by ASIO in the title...

    • @javidx9
      @javidx9  4 года назад +27

      Lol yes, its quite an unfortunate coincidence!

    • @ВячеславЗамулов
      @ВячеславЗамулов 4 года назад +1

      @@javidx9 I wish there were more tutorials on Steinberg's ASIO, lol

    • @user-yr1uq1qe6y
      @user-yr1uq1qe6y 4 года назад

      I thought the exact same thing when I saw the title come up.

    • @lucadavidian5441
      @lucadavidian5441 4 года назад

      Me too!

    • @foamyrocks665
      @foamyrocks665 4 года назад

      Me too. They aren't related? I thought the ASIO audio drivers are based on the concepts shown here from the ASIO library.

  • @calogiga
    @calogiga 8 месяцев назад

    I want to thank you for this awesome tutorial. It's the first time that I was able to use and understand asio. Such easy examples are so rare on youtube. Thank you again, sir.

  • @joidshgoi5435
    @joidshgoi5435 3 года назад +4

    For anyone following along with clion + mingw + cmak, be sure to add
    if(MINGW)
    target_link_libraries(learning_asio ws2_32)
    endif()
    to your CMakeLists.txt. Otherwise you'll get a bunch of "undefined reference to xxx..." errors when trying to compile around 9:00 mark.

  • @祝中良
    @祝中良 Год назад

    Hey, guy. I'm so glad that I can see your video from a single RUclips Searching. It really impresses me when I have the first glance on the content of your video. I'm sure it's what I'm searching for. Don't be bothered by those negitive comments. Just let it go. BTW, I'm curious about do you have any serious about multi-threading of C++. I'm really eager to find such kind of materials. Since I want to switch my career from a SDET to C++ developer. They're so many things I need to learn and your course are just what I need. They're not just "hello world", they're valuable resources that can help me in my actual work and interview. Thank you so much again.

  • @billybest5276
    @billybest5276 4 года назад +4

    this was great, can't wait for the rest of the series.

  • @-argih
    @-argih 4 года назад

    I'm installing VS community after 5 years away from coding just to follow this tutorial, i think you have read this a million times but the way you structure the information is not so simplified that it became boring but not so advance that you basically need to be a master in the topic beforehand, after 10 minutes of your video i subscribed to your channel

  • @drel9300
    @drel9300 4 года назад +3

    Thanks a lot for making this video and that is incredibly helpful! However, I have some questions on the static_assert regarding the trivially copyable types (around 35:00 in the video).
    The first question is that since you mentioned "trivially copyable", I assumed that "is_trivially_copyable" trait should be used to enforce memcpy-safety, but why is "is_standard_layout" used instead in this case?
    The second question is that when you do the serialization/deserialization for data transmitted between different machines, how can we make sure the sizeof(header) or the bitwise representation of the custom data is the same on different platforms with the same code, given that the same structs may have different alignments and paddings? Although in the example you gave I guess a struct containing two uint32_t should generally be packed densely into a 64 bit chunk, I am worried that different compilers may treat other types of POD structs with different bit representation.
    Thanks!

  • @mattwhelan13
    @mattwhelan13 4 года назад +1

    I don't think it's an understatement to say that this video is something that I've wanted for years

    • @javidx9
      @javidx9  4 года назад +1

      Well this one starts with very basic but necessary building blocks, the real fun stuff comes next!

    • @mattwhelan13
      @mattwhelan13 4 года назад

      @@javidx9 precisely, a lot of people skip to the cool stuff but you explain really well what you actually need to do to get set up, it's refreshing

  • @anonanon3066
    @anonanon3066 4 года назад +3

    I always missed that "one" library for c++ networking.. THANK you!
    libcurl is nice but a pain to work with it's C syntax...
    ASIO is great! Thanks for showing me this!
    Also, thanks for taking the time for making all these videos. You truly are a gift for the c++ community.

    • @javidx9
      @javidx9  4 года назад +1

      Thanks Anonx2!

    • @PaweSkalczynski
      @PaweSkalczynski 4 года назад

      Also please note that C++ Networking TS is being specified on ASIO. There are lots of people holding thumbs that in the end we will have standard networking for C++23 (so 2023 :) )

  • @Otakutaru
    @Otakutaru 4 года назад +2

    Every. Single. Video you make... Is helpful and entertaining. Thanks!

    • @javidx9
      @javidx9  4 года назад +1

      Hey thanks Otakutaru, glad to see they are appreciated!

  • @selami32
    @selami32 4 года назад +45

    i dont have enough IQ to understanding these courses so i watch these when i need to sleep

    • @southernkatrina8161
      @southernkatrina8161 4 года назад +3

      And ASIO is Australia's government spy network. Australian Security Intelligence Organisation....

    • @re.liable
      @re.liable 4 года назад +1

      Holy sh- same lol

    • @mihapetek3418
      @mihapetek3418 3 года назад +2

      @@southernkatrina8161 ASIO is also music production program...

    • @unlikelysalmon786
      @unlikelysalmon786 3 года назад +6

      @@southernkatrina8161 ASIO is also 4/5ths of a calculator

    • @ASCENDANTGAMERSAGE
      @ASCENDANTGAMERSAGE 3 года назад +1

      I bet you are smart enough, just not interested. Which is a-okay. :) His voice is very soothing even for those of us who do watch for the content.

  • @funtara6571
    @funtara6571 Год назад

    @30:31 (Creating Message) your memberfunction size_t size() on the video calculate the size of the msg (msgheader + body), but on the github repo you use only the bodysize. If you create msg like @(30:31) the client program will only do one ping to the server (the roundtime is miscalculated) and you can press the "1"-key so often you want, you dont get any pingmsgs. Btw: great explanation of the architecture and of the new c++ sugar. -- thx --

  • @walidjabari4985
    @walidjabari4985 4 года назад +12

    corporate: "so which versions of visual studio do you want to install on your computer ?"
    javidx9: "yes"

  • @MuhammadArshad
    @MuhammadArshad 3 года назад

    I have never clicked on part 2 of any video series as faster as I did for this one. Thank you so much.

  • @UrThysis
    @UrThysis 4 года назад +13

    I don't understand how people could dislike this video 🙄

    • @MatthewChaplain
      @MatthewChaplain 4 года назад +4

      I liked the video because it's a really good and accessible intro to modern C++ networking and the inherent complexity in the domain. I use Asio myself. But the video does have a few problems that might irk some developers. The unsigned size, which is such a small thing, might be one of those things. But probably for the "thread-safe" queue. Consider a thread that calls q.front() and then inspects the result of that function. Meanwhile, another thread has called pop_front(), invalidating the reference that the first thread is inspecting. Adding locks in this way doesn't necessarily make an object thread-safe; it very much depends on the usage patterns.

    • @evalaviniabucur1789
      @evalaviniabucur1789 4 года назад +1

      They're either trolls or don't understand the code even after seeing the video. I always like javidx9 videos, even though I never code in C/C++ and there are parts I don't understand. I enjoy all his explanations and the approaches he has on various problems.

  • @Adrian_Fleck
    @Adrian_Fleck 3 года назад

    In my opinion really the best c++ and programming in general Tutorials out there, I know its a big statement, but I´ve watched a lot of tutorials and read a lot of them.

  • @samuelcampbell6559
    @samuelcampbell6559 3 года назад +6

    "Oh no _not Boost_"... I laughed out loud.

  • @pointyhairedboss1
    @pointyhairedboss1 3 года назад +1

    I was looking for a quick intro to asio and this was great. Thank you.

  • @RogueShadowTCN
    @RogueShadowTCN 4 года назад +4

    Every time, the two different audio recordings throw me for a loop. Although it works, hearing the ambient room noise when you're facing the camera suddenly makes me feel like I'm in the room with you. ...

    • @dhkatz_
      @dhkatz_ 4 года назад

      I think that's the point. It's more personal. I don't see the issue

  • @Dygear
    @Dygear 4 года назад +1

    Oh no! This video came out 3 days ago, and I was hoping to hop right into Part 2 to see how the rest of the code comes together. I am actually starting to write a client / server infrastructure and this is a VERY good introduction into ASIO.

  • @nekoest
    @nekoest 4 года назад +5

    Networking? WOOOOOOOOOOOO!

  • @logc1921
    @logc1921 4 года назад

    The timing couldn't be perfect! I am making a raycaster with LAN. You are so helpful!

  • @rondYT
    @rondYT 4 года назад +3

    Me trying to learn C++: 🤓
    Me trying to learn Server-Client in C#: 😎
    Me when I get this video recommended: 🥵

    • @LuisA-qm8om
      @LuisA-qm8om 4 года назад +1

      What I did is copy&paste functional code, and then modify it until i understand it;

  • @phyl568
    @phyl568 2 года назад

    Thank you so much, i'm working on a (boost asio) TCP-UDP hybrid protocol, I've been stuck for the past three hours and you helped me figure out my problem ! You got a sub

  • @slartibartfastBB
    @slartibartfastBB 4 года назад +3

    For MacOSX use
    $ brew install asio

    • @javidx9
      @javidx9  4 года назад +1

      Cool, thanks!

  • @Kyagara
    @Kyagara 4 года назад +2

    As someone that loves MMOs, this is something I've always wanted to learn more about, thanks for the video!

  • @jontnoneya3404
    @jontnoneya3404 4 года назад +4

    "We're not going to use sockets because...."
    First thing we do is create a socket

    • @codeman99-dev
      @codeman99-dev 4 года назад

      Yes, exactly. Sockets suck ...until they don't.

  • @quentinquadrat9389
    @quentinquadrat9389 4 года назад +2

    I did not know ASIO until your video, it looks having a clean API. Nice !

  • @neuro5261
    @neuro5261 4 года назад +3

    3:03 he mistakenly says "boost asio" and hovers over boost_asio_1_18_0.zip
    Just to clear up confusion it is just asio-1.18.0.zip

    • @wizardy6267
      @wizardy6267 4 года назад +1

      He means it. if ppl downloaded the non-boost version. The `#define ASIO_STANDALONE` is not required anymore.

    • @neuro5261
      @neuro5261 4 года назад

      ​@@wizardy6267 Writing #define ASIO_STANDALONE would make sense if he downloaded boost asio but he didn't. At 3:39 is his file "asio-1.18.zip" and not "boost_asio_1_18_0.zip" ?

    • @wizardy6267
      @wizardy6267 4 года назад

      @@neuro5261 I didn't pay attention to 3:39. But I used the asio-1.18. When I tried to build. The compiler complained the macro `ASIO_STANDALONE` redefined in the library. Since he still has the macro defined. I guess either the warning is suppressed or he is using the boost version. Or maybe the 3:39 is the mistaken spot. :p

    • @sirgouki6207
      @sirgouki6207 4 года назад

      @@wizardy6267 I don't get that warning with mine, and I'm using the non-boost version. With the boost version, even with standalone set, I was still having to tell it to use boost::asio:: instead of asio::

  • @goglom12
    @goglom12 3 года назад +1

    You also can use SFML Network module, it have a very simple interface to TCP\UDP Sockets and also have a SocketSelector!

  • @youtissoum
    @youtissoum 3 года назад +3

    anyone know how to fix the problem of std::scoped_lock not begin defined in the tsqueue

    • @javidx9
      @javidx9  3 года назад +3

      Sure, enable c++17 for your compiler

    • @youtissoum
      @youtissoum 3 года назад

      ​@@javidx9 how do you enable it (i'm using vs 2019)

    • @javidx9
      @javidx9  3 года назад +3

      @@youtissoum project properties, language standard, c++17

    • @youtissoum
      @youtissoum 3 года назад

      @@javidx9 thanks it dont give me errors anymore

  • @AmberHearts
    @AmberHearts 4 года назад

    This is explained in a really easy to digest manner and I'm really happy it showed up in my recommendations.
    If all your videos are of this quality then I have a lot to sit through in the nearest future!
    Great work!

  • @gradyshastid3704
    @gradyshastid3704 4 года назад +7

    Why did you have to do this after I just spent the last six months learning socket programming.

    • @CottidaeSEA
      @CottidaeSEA 4 года назад

      Six months for learning sockets?! How can you even spend that long on sockets?

    • @gradyshastid3704
      @gradyshastid3704 4 года назад +5

      @@CottidaeSEA most of it was just making data structs for it. I am building a scripting language and wanted it to work with socket programming.

    • @CottidaeSEA
      @CottidaeSEA 4 года назад +5

      @@gradyshastid3704 Now it makes a whole lot more sense why it'd take that long. Because normally I can't imagine it taking more than a month, but that's still in-depth and with a couple of smaller projects to gain experience using them.
      As a side note, the two first things I made with sockets was a basic messenger and a battleships game. I already had the game ready, so I just slapped some multiplayer functionality onto it... though due to it being P2P one of the players could cheat by reading the memory, but I couldn't be bothered to add a server onto it. Even though I probably could've used the messenger server for it.
      Edit: this side note became the majority of the reply... well, shit.

  • @gasparRaduB
    @gasparRaduB 4 года назад

    Reminiscent of an event driven pub sub. A very clean and simple approach to implementing, what is traditionally, a complex problem. As always and as expected, OLC describes everything in a very easy to understand and digest manner. Nicely done.

  • @TheKluxi1
    @TheKluxi1 4 года назад +4

    hello

  • @irbaboon1979
    @irbaboon1979 4 года назад

    Haven’t touched C/C++ in years to be honest - but the way you describe and explain makes me want to pick it up again for fun. Great videos!

  • @GNARGNARHEAD
    @GNARGNARHEAD 4 года назад +3

    the Australian Security Intelligence Organisation? sus

  • @alexb6568
    @alexb6568 4 года назад

    Finally an explanation for this kafkaesque and nebulous library in English, unlike the confusing "tutorials" on the Boost::Asio site.

  • @tryingtocorrect
    @tryingtocorrect 2 года назад

    I would vote this serious one of the best video series in youtube. Top 3 definitely.

  • @SparxableTunes
    @SparxableTunes 3 года назад +1

    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

  • @Picpizza
    @Picpizza 2 года назад +1

    I found this very useful and I enjoyed your presentation. It was fun, and has lots of value.
    Pedagogical goodness!
    (also, your chrono dig was funny!)

    • @javidx9
      @javidx9  2 года назад

      Thanks John!

  • @CediCore
    @CediCore 6 месяцев назад

    Sir, they way you talk makes me very comfortable ❤ thank you.

  • @samuelhulme8347
    @samuelhulme8347 2 года назад

    “Stepping through every line of code”, I wished my debuggers explained like you 👍

  • @GregoryTheGr8ster
    @GregoryTheGr8ster 4 года назад

    I have never been far enough along in one of my projects to need to dive into networking. Thus, I know that the day that I need to make this dive, I will have made real progress. It will be a cause for celebration, possibly with champagne.

  • @TheAngelOfDeath01
    @TheAngelOfDeath01 4 года назад +1

    BEST place on the internet for learning C++!

  • @farzadfarzady1282
    @farzadfarzady1282 Год назад

    Excellent indeed. One of the best modern C++ videos I have seen & you get ASIO thrown in as well. MANY thanks. You are a very cool guy 🙂

  • @DIDIJEANPHI
    @DIDIJEANPHI 4 года назад

    Great vid !!! I've been using ASIO for many projects at work. I really love the way you introduced it.

  • @jphvnet
    @jphvnet 4 года назад +1

    I'll check these videos... it was painful debugging my first app. Fortunately I never needed again, but I want to learn

  • @eldarcuric3992
    @eldarcuric3992 4 года назад +1

    I truly enjoy your content, keep up the work, I'll contribute as soon as this specific timeline that we are in right now comes to pass.

  • @rebollo87
    @rebollo87 2 года назад

    This is the 3rd time that I am going to see this videos to completely understand them and I will say that THIS IS PURE GOLD. This will save weeks of study and therefore THANK YOU.
    That said, it will be I think be clarifying I think for everyone if you could dedicated some minutes to explain asio executors and completion handlers even tho I know that this can be out of the scope of this videos but just with the intention of clarifying some important concepts.
    Thank you so much for your contribution.

  • @katapoka
    @katapoka 4 года назад +2

    Such amazing coding skills and teaching technique. I really like your content. THanks

  • @chainq68k
    @chainq68k 4 года назад +2

    I don't even like C++, but I still watch these videos for the engineering thought going into the code. So much to learn from that alone.

  • @DavidDachaDjordjevic
    @DavidDachaDjordjevic 4 года назад +1

    I am so looking forward to the next parts. I enjoyed so much watching you opening new doors for so many possibilities for a game I have on my mind. Thank you sir! Much love. :)

  • @yjc149
    @yjc149 Год назад

    one of the best presentation of Asio.

  • @1J03B
    @1J03B 3 года назад

    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.

  • @camwin7
    @camwin7 4 года назад +1

    This series looks fantastic. Its very difficult to find information on standalone asio, and the examples provided with it are very lacking.
    Looking forward to the rest of the videos!

  • @JustYesntMan
    @JustYesntMan 4 года назад +1

    I am using QT for all my needs but this is also good to know, thank you sir

  • @Hato1992
    @Hato1992 4 года назад

    I love to see actuall message implementation. I tried to make multiplayer game in the past, but gave up. Not because it was hard, just lost interest and never finished multiplayer for it.

  • @r1pfake521
    @r1pfake521 4 года назад

    Awesome, I made something similar in C# a while ago, based on SocketAsyncEventArgs, but it was mostly just to learn something new, I only used it for a few small turn based games. Currently focused on a new single player project, but one day I will continue multiplayer stuff. Watching this and taking notes to improve my own C# library in the future.

  • @kell7689
    @kell7689 4 года назад

    Imma click on this video and like it because a few months ago, I was trying to do networking in C++ and found ZERO good video references. Good work sir.

  • @Zethneralith
    @Zethneralith 4 года назад

    I'm working exclusively in C#, but the thought process behind this is really useful. I've worked with networking on the small scale for a while, but I've wondered what the best practices were for handling communications between client/server like this for a while.

  • @jandastroy
    @jandastroy 4 года назад

    I just discovered your channel and I am loving your style of humor and presentation. Thanks for sharing!

  • @eddek6141
    @eddek6141 4 года назад +1

    Let's fucking go!!!! I changed to and learned c++ in last 6 months for mmo networking

  • @conatcha
    @conatcha 3 года назад +2

    Thanx for your awesome crystal explanations! That is SOOO great and useful.
    46:27 Does make any sense that you use std::move() with a const variable in the push functions though?
    55:02 Calling .release() on a unique_ptr would relinquish the inner C pointer! Maybe you wanted to use .reset() instead to release the memory?

    • @herrdingenz6295
      @herrdingenz6295 3 года назад +3

      @conatcha it doesn't make any sense to use std::move on a const object (especially not in combination with emplace_back)
      i had a debate with javidx9 1 or 2 months ago about this issue and he basically told me to "f*ck off"
      take a look at Jason Turner's C++ weekly episode about emplace_back and push_back ;)

    • @conatcha
      @conatcha 3 года назад +1

      @@herrdingenz6295 F'ng YT is randomly deleting my comments, I don't know why. In my previous message I said thank you fo your answer and that I was sorry to read that you couldn't get to any conclusion with the channel's owner.

    • @herrdingenz6295
      @herrdingenz6295 3 года назад +3

      @@conatcha i read your previous post .. and yes - YT is randomly deleting comments

  • @dennisrkb
    @dennisrkb 2 года назад

    Glad I found your channel, you have a way of conveying things. Can people vote on your next topic?

  • @nordern1
    @nordern1 4 года назад +2

    In this series, are you going to go into the complications of multiplayer games in particular, like server validated player movement that doesn't feel choppy, for example?

  • @mohamedmoatyhassan5125
    @mohamedmoatyhassan5125 4 года назад +2

    Thank you for providing this quality content for free!

    • @javidx9
      @javidx9  4 года назад +2

      Glad you enjoy it!

  • @rudolphbennett3988
    @rudolphbennett3988 4 года назад +1

    What an excellent C++ demo, javidx9