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?
@@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.
@@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.
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.
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.
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.
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.
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
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.
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.
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 (:
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!
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.
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.
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.
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.
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.
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!
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!
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!
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.
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.
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.
@@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.
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"
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.
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.
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.
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
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!
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.
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 :) )
@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 --
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.
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.
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.
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. ...
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.
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
@@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" ?
@@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
@@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::
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 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.
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.
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
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.
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.
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. :)
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.
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!
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.
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.
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.
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.
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?
@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 ;)
@@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.
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?
For all those unconvinced it can work, please download and try the prototype project here! onelonecoder.itch.io/meaningless-cog
Decided to provide some tea for this quality content ;) Keep up the good work.
Thank you Zaneris! Much appreciated!
Yeah asio comes with ssl objects you can use to negotiate https. A bit too complex for a simple introduction 😁
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?
thanks for all the work you do! as someone learning c++, you are truly helpful thank you
I have no idea what i'm watching, but thank you bearded man for the knowledge.
Best comment ever XD
I work in IT, and the only thing I understood was the networking lol
HTTPS changed the strings being sent in plain text though
You have to see "Hands on Machine Learning whit python"...
@@LockeIProd and that does not count from 1 lmao
This man will always be the person I go to for difficult c++ programs
It's a real shame he refuses to use modern C++ idioms and techniques.
@@superscatboy Cniles are set in their ways
@@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.
@@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.
@@superscatboy Well, the best modern C++ idiom in most cases probably is to ditch it for Rust ;-)
Stop and realize for one moment how great the content OLC has been posting. Really amazing.
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.
this video is explanation of how web works under the hood.
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.
still how can i make my vs work with that?
@@crazypeter113 check the properties files vscode creates, there must be some sort of parameter for includes iirc
this ^^^
Thank you, omg lol I was getting pissed lol
thanks bro, you saved me a lot of time and headache.
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.
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.
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
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.
Hey thanks buddy! It's a formula that works.
I can't keep away from these videos. I've watched and listened to so many of them.
I don't use C++.
C++ is for people who like to find problems for their solutions.
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.
thanks for the tips dude!
讲得真好,谢谢老师!以前复制示例,一知半解,也能用,今天听了老师的讲解豁然开朗!
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 (:
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!
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.
this dude makes everything looks simple
A lot of mental effort was clearly put into making this video as informative as it could be. Thank you for your hard work.
I don't think I've ever clicked on a video faster
I know, right?
@@filmcase1683 MAIAMAIAMIAMAIAMIAMAIMAIMAIAMIAMAIMA
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.
[2]
same my dude
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.
Golden content, yet it's free. Appreciate it people :-)
@Rusty Boomerton We know
The first 20 minutes are beyond gold, bearded man.
I am really interested to see this !!! Much needed !!!
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.
Your user name gives me anxiety
@@stewartzayat7526 Not the first time I have heard this))
@@SourceCodeDeleted you make me want to create another account named "Executable Reverse Engineered" lol.
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!
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.
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.
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!
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!
Glad you enjoy it doublegdog!
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!
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.
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.
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.
@@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.
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"
This!
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.
Hi wowLinh - yeah, i really want to avoid the traditional means of describing this architecture, its just boring :D
Coming from a music production background, I was very confused by ASIO in the title...
Lol yes, its quite an unfortunate coincidence!
@@javidx9 I wish there were more tutorials on Steinberg's ASIO, lol
I thought the exact same thing when I saw the title come up.
Me too!
Me too. They aren't related? I thought the ASIO audio drivers are based on the concepts shown here from the ASIO library.
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.
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.
*only on windows
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.
this was great, can't wait for the rest of the series.
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
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!
I don't think it's an understatement to say that this video is something that I've wanted for years
Well this one starts with very basic but necessary building blocks, the real fun stuff comes next!
@@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
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.
Thanks Anonx2!
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 :) )
Every. Single. Video you make... Is helpful and entertaining. Thanks!
Hey thanks Otakutaru, glad to see they are appreciated!
i dont have enough IQ to understanding these courses so i watch these when i need to sleep
And ASIO is Australia's government spy network. Australian Security Intelligence Organisation....
Holy sh- same lol
@@southernkatrina8161 ASIO is also music production program...
@@southernkatrina8161 ASIO is also 4/5ths of a calculator
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.
@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 --
corporate: "so which versions of visual studio do you want to install on your computer ?"
javidx9: "yes"
I have never clicked on part 2 of any video series as faster as I did for this one. Thank you so much.
I don't understand how people could dislike this video 🙄
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.
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.
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.
"Oh no _not Boost_"... I laughed out loud.
I was looking for a quick intro to asio and this was great. Thank you.
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. ...
I think that's the point. It's more personal. I don't see the issue
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.
Networking? WOOOOOOOOOOOO!
how isp is spying you?
The timing couldn't be perfect! I am making a raycaster with LAN. You are so helpful!
Me trying to learn C++: 🤓
Me trying to learn Server-Client in C#: 😎
Me when I get this video recommended: 🥵
What I did is copy&paste functional code, and then modify it until i understand it;
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
For MacOSX use
$ brew install asio
Cool, thanks!
As someone that loves MMOs, this is something I've always wanted to learn more about, thanks for the video!
"We're not going to use sockets because...."
First thing we do is create a socket
Yes, exactly. Sockets suck ...until they don't.
I did not know ASIO until your video, it looks having a clean API. Nice !
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
He means it. if ppl downloaded the non-boost version. The `#define ASIO_STANDALONE` is not required anymore.
@@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" ?
@@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
@@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::
You also can use SFML Network module, it have a very simple interface to TCP\UDP Sockets and also have a SocketSelector!
anyone know how to fix the problem of std::scoped_lock not begin defined in the tsqueue
Sure, enable c++17 for your compiler
@@javidx9 how do you enable it (i'm using vs 2019)
@@youtissoum project properties, language standard, c++17
@@javidx9 thanks it dont give me errors anymore
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!
Why did you have to do this after I just spent the last six months learning socket programming.
Six months for learning sockets?! How can you even spend that long on sockets?
@@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.
@@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.
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.
hello
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!
the Australian Security Intelligence Organisation? sus
Finally an explanation for this kafkaesque and nebulous library in English, unlike the confusing "tutorials" on the Boost::Asio site.
I would vote this serious one of the best video series in youtube. Top 3 definitely.
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
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!)
Thanks John!
Sir, they way you talk makes me very comfortable ❤ thank you.
“Stepping through every line of code”, I wished my debuggers explained like you 👍
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.
BEST place on the internet for learning C++!
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 🙂
Great vid !!! I've been using ASIO for many projects at work. I really love the way you introduced it.
I'll check these videos... it was painful debugging my first app. Fortunately I never needed again, but I want to learn
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.
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.
Such amazing coding skills and teaching technique. I really like your content. THanks
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.
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. :)
one of the best presentation of Asio.
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.
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!
I am using QT for all my needs but this is also good to know, thank you sir
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.
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.
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.
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.
I just discovered your channel and I am loving your style of humor and presentation. Thanks for sharing!
Let's fucking go!!!! I changed to and learned c++ in last 6 months for mmo networking
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?
@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 ;)
@@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.
@@conatcha i read your previous post .. and yes - YT is randomly deleting comments
Glad I found your channel, you have a way of conveying things. Can people vote on your next topic?
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?
Thank you for providing this quality content for free!
Glad you enjoy it!
What an excellent C++ demo, javidx9