C++ Network Programming Part 1: Sockets

  Рет қаралды 146,008

Nicholas Day

Nicholas Day

Күн бұрын

Пікірлер: 88
@stainie
@stainie Жыл бұрын
This series alone is worth more than a bunch of paid Udemy courses. Thank you Nicholas for sharing your knowledge!
@smizal4834
@smizal4834 Жыл бұрын
Yeah, for sure. This guy deserves millions
@abdelrahmanyasser5720
@abdelrahmanyasser5720 6 ай бұрын
and a 100 videos playlist, just wrapped in 13 videos
@holesmak
@holesmak 2 жыл бұрын
this is pure gold. Havent watched to the end yet but it gives a lot of understanding on the subject in c++
@paolocherubini6536
@paolocherubini6536 2 жыл бұрын
Socket is a tricky issue and you explained It very well. Thank you for your pronunciation that sounds perfect to an italian native speaker.
@NicholasDayPhD
@NicholasDayPhD 2 жыл бұрын
Glad it was helpful!
@kaloyanbadankov5879
@kaloyanbadankov5879 2 ай бұрын
Incredible. Half an hour in and the content is pure quality. Thank you sincerely!
@NicholasDayPhD
@NicholasDayPhD Ай бұрын
Thank you so much - so glad this helped you!
@samuelsantoshernan5093
@samuelsantoshernan5093 2 жыл бұрын
Oh, my god. This channel deserves infinitely more suscriptors. Perfectly well explained such a difficult topic! Thank you so much for this!
@Darthrein
@Darthrein 8 ай бұрын
This series is seriously underrated for such a high quality explanation!
@NicholasDayPhD
@NicholasDayPhD 8 ай бұрын
Thank you so much - glad this material helps you!
@zecuse
@zecuse 9 ай бұрын
For anyone wondering, AF_INET is for IPv4 type addresses not TCP or UDP. AF_INET6 is used for IPv6 addresses. Only the _type_ parameter of the socket function is responsible for determining if it will be TCP or UDP.
@paulmathew1214
@paulmathew1214 2 жыл бұрын
Great video! I have previously done work with sockets in python but wanted to learn how to do it in c++ and this tutorial was perfect! Easy to understand and gave me the fundamentals to do what I want.
@purpletom_yt3138
@purpletom_yt3138 6 ай бұрын
Same!
@SumanthLingappa
@SumanthLingappa 4 күн бұрын
Nice video. 18:10 TCP is not secure by itself, otherwise there wouldn’t be SSL/TLS. TCP is a reliable protocol.
@robn2497
@robn2497 9 ай бұрын
After 2hours typing all the code in manually, it worked :)
@Jus4trail
@Jus4trail 9 ай бұрын
Hello can you help me out in understanding socket
@iNFiNiTY-yf3rk
@iNFiNiTY-yf3rk Жыл бұрын
Waiting for part 2! It's such a great video tbh. Best one about this topic
@ricardoricardorodriguez8368
@ricardoricardorodriguez8368 Ай бұрын
This is gold for me. Thank you
@NicholasDayPhD
@NicholasDayPhD Ай бұрын
You're very welcome!
@Saleh_Mohammd
@Saleh_Mohammd Жыл бұрын
Thanks bro, clean voice, clean code❤
@SaintMorning
@SaintMorning 2 жыл бұрын
Thank you for hosting all your lectures. Your lessons are very awesome. I think using: using namespace std Is in general not good because of namespace cluttering Thank you so much for your lessons!! truly appreciated.
@NicholasDayPhD
@NicholasDayPhD 2 жыл бұрын
Very kind of you to write this feedback - noted for future!
@_CyberFreak_
@_CyberFreak_ Ай бұрын
but it's cleaner and it doesn't cause problems usually
@virtualsocialretreat8234
@virtualsocialretreat8234 2 жыл бұрын
this was super entertaining and informative, even though it's in a language i don't use. subscribed
@ragdoll_physics
@ragdoll_physics 2 жыл бұрын
Ah, I wish you had done the presentation using a UNIX environment but nonetheless the explanation was superb and it was very useful for me. Thanks and bless you.
@NicholasDayPhD
@NicholasDayPhD 2 жыл бұрын
Thanks so much - it's not too difficult to get this working in a UNIX environment. The functions should be the same!
@uanbu6539
@uanbu6539 Жыл бұрын
Where can I download the stdafx.h header file????
@mersenne2486
@mersenne2486 Жыл бұрын
awesome lecture
@nikhilt3755
@nikhilt3755 11 ай бұрын
37:00 af_inet refers to ipv4, not tcp or udp. af_inet6 refers to ipv6.
@d4sty.
@d4sty. 9 ай бұрын
so how do i know if the client uses ipv6 or ipv4??? does it still connect you if you are on a different one?
@cyberjayson
@cyberjayson 2 ай бұрын
@@d4sty.Most of the time it’ll be ipv4… You can also edit it so it can look for which ever protocol version the client uses, then connects to the one it finds. But it’ll usually be ipv4
@abhishekharis6673
@abhishekharis6673 2 ай бұрын
I love you dude
@UnrealCatDev
@UnrealCatDev Жыл бұрын
Seems interesting. Fortunately I want to implement networking for my games and engine in a short future
@aryanab3292
@aryanab3292 Жыл бұрын
Nice!
@emersondejesusgrandatilano3427
@emersondejesusgrandatilano3427 2 жыл бұрын
hello i was wondering about where i can find that word document where is all the step by step plss
@amandojuarez8216
@amandojuarez8216 2 жыл бұрын
Hello sir, I was wondering how you added the two header files(stdafx.h & targetver.h)? I cant seem to figure it out on visual studio 2019
@tyasto6024
@tyasto6024 11 ай бұрын
Did you add them ? if yes, how please
@winuxworx
@winuxworx Жыл бұрын
Can you please share the document reference you are using in the video?
@pastori2672
@pastori2672 7 ай бұрын
love it tysm
@hicham2668
@hicham2668 Жыл бұрын
Crystal clear, thank you so much🙏
@mafi_tube
@mafi_tube Жыл бұрын
Thank you for sharing this very good lecture! One question please, @37:40 don't we need the shutdown() function before calling the WSACleanup() and before calling the closesocket()?
@KP_100
@KP_100 Ай бұрын
Can anyone tell this lecture is for windows ?
@sleepyNovember_project
@sleepyNovember_project 5 күн бұрын
of course, lol
@chaoyin1263
@chaoyin1263 Жыл бұрын
Thank you so much for these videos!! But I do not know where can I find your word document. 😭
@kennethmanheim265
@kennethmanheim265 2 жыл бұрын
1:01:53 How do i do this on different Machines?
@kpfxzzsy
@kpfxzzsy Жыл бұрын
thank you, could you take another video in c#, I very need it.
@OriginalDungeonSynthComp-ex8dc
@OriginalDungeonSynthComp-ex8dc 2 ай бұрын
"InetPton" was not declared in this scope. Got all the headers, libraries, everything.
@osmanemredonder3604
@osmanemredonder3604 2 жыл бұрын
Hello, I would like to ask if other computer can connect to that server and send binary text?
@scienceandengineering3827
@scienceandengineering3827 Жыл бұрын
very great
@amortalbeing
@amortalbeing 10 ай бұрын
Thanks a lot
@learningdatasciencealongme190
@learningdatasciencealongme190 2 жыл бұрын
Where can we find notes sir ?
@NicholasDayPhD
@NicholasDayPhD 2 жыл бұрын
Hi there - the notes for this course are based on Lippman's book on C++. Here is a simplified tutorial that may help: www.geeksforgeeks.org/socket-programming-cc/
@rajeshbnarasimha934
@rajeshbnarasimha934 Жыл бұрын
Hi Mr. Day, I have encountered an error on codeblocks, and I have included all the supporting files u mentioned but compiler says, "InePton was not declared....." Could you please get me through this..
@liquidatedrice5274
@liquidatedrice5274 Жыл бұрын
Putting "#define _WIN32_WINNT _WIN32_WINNT_VISTA" before "#include " and "#include " worked for me. This means Windows Vista is the oldest OS your code will work on though.
@ShirChoi
@ShirChoi Жыл бұрын
Did you find the answer for you question? I am facing the same problem rn and can't find the answer
@rajeshbnarasimha934
@rajeshbnarasimha934 Жыл бұрын
@@ShirChoi this series gives u a good outlook of what socketprogramming is. However, it doesn't work on codeblocks. I would recommend kzbin.info/aero/PLhnN2F9NiVmAMn9iGB_Rtjs3aGef3GpSm&feature=shared
@matrixplaysforever
@matrixplaysforever 5 ай бұрын
I know that this comment is 1 year old but this solution if for others to also see fix that worked for me : 1) include 2) in the place of the string _T("127.0.0.1") replace it with L"127.0.0.1"
@refuro
@refuro 2 жыл бұрын
Thank you for making this video. Is there any way you can link the project files in the description? I also have maybe a somewhat naive question, but since we are using windocks, I'm assuming it's meant for windows. Will this also be compatible with linux-based Operating systems? Have a great day!
@NicholasDayPhD
@NicholasDayPhD 2 жыл бұрын
Hi there, yes, I have managed to code this on a Mac too (and confident it would be similar for Linux). The functions such as socket(), bind(), listen(), connect(), accept(), send(), recv() etc are the same for both Windows and Mac. Main differences are the low level Windows types (such as DWORD) are substituted for strings and integers with Mac. And rather than libraries winsock2.h and ws2tcpip.h, there are equivalent libraries such as arpa/inet.h, netdb.h, sys/socket.h, sys/types.h and unistd.h for Mac solutions.
@raghuvaranpothuganti
@raghuvaranpothuganti 2 жыл бұрын
@@NicholasDayPhD Hi Thank you very much for the detailed lectures. Would you please help me providing the info on how can we implement these in mac. Because we need two processes server and client, can we achieve this in mac terminal or do we need any IDE?
@NicholasDayPhD
@NicholasDayPhD 2 жыл бұрын
@@raghuvaranpothuganti I've managed to run similar code via the IDE Visual Studio Code (to compile the source C++ code in to an executable application). You can also get Visual Studio for Mac, or you may even prefer the IDE CLion by JetBrains (same developers of IntelliJ). Basically, you just need an IDE to compile the source code! Once compiled, clicking on the application will launch a terminal window. For this basic example, I had two terminal windows on the the same Mac (one for server, one for client). However, you could configure the applications to talk to each other across a network. Hope that helps...
@abderrahmanechahdane4814
@abderrahmanechahdane4814 Жыл бұрын
@@NicholasDayPhD i guess you don't need the initialize WSA part, in linux based systems right ?
@Sidhuhalalwala
@Sidhuhalalwala 8 күн бұрын
where are the files for this?
@rohanpatil2605
@rohanpatil2605 5 ай бұрын
pure goldmine
@snaileny
@snaileny 3 ай бұрын
Why aren't we calling closesocket() when acceptSocket fails?
@sanjurdx3077
@sanjurdx3077 3 ай бұрын
f
@mercury6804
@mercury6804 3 ай бұрын
Why do we even need to close them? Microsoft documentation says that all open sockets are automatically reset and deallocated once WSACleanup() is called.
@deveep339
@deveep339 11 ай бұрын
why would you make it white its so bright my developer eyes cant handle this
@MalamIbnMalam
@MalamIbnMalam Жыл бұрын
I assume that this would be similar to network programming with C++ in Linux
@uroojfatima6456
@uroojfatima6456 10 ай бұрын
No.
@EscapeVelocity1
@EscapeVelocity1 3 ай бұрын
No. This isn't even C++, it's the Windows API.
@tuti8452
@tuti8452 Жыл бұрын
please share word document
@syedzainalishah749
@syedzainalishah749 2 жыл бұрын
well explained please can you send me PPT lectures
@abcz___hello
@abcz___hello Жыл бұрын
👏👏🙏
@hardbrocklife
@hardbrocklife 2 жыл бұрын
Another source code tutorial I found uses int LISTENONPORT(int portno) as its entry point. Why, and why does this source code seem to loath my existance lol? Python is just like "Do socket stuff on X socket" and it just goes.
@duydug9967
@duydug9967 Жыл бұрын
uhm, i don't know. i am a person who don't like long video ;-;
@Tech_Code127-76
@Tech_Code127-76 Жыл бұрын
Why don't you just dive right in? Some of us hate "theory" just explain things while you code! Otherwise great video!
@kidkyle712
@kidkyle712 11 ай бұрын
Because that's stupid. "Diving right in" just encourages people to type over and barely learn anything. It's important to understand the concepts you're going to implement before actually implementing them.
@ihuh1000
@ihuh1000 Ай бұрын
he included timestamps so people who dont wanna learn theory can skip it, why are you being bitchy for no reason?
@hamoudiayoub9341
@hamoudiayoub9341 Ай бұрын
Networking programming in windows is fake
@sss-og7jx
@sss-og7jx 2 жыл бұрын
really like your c++ series! I would like to know where can I get stdafx.h and targetver.h files.
@NicholasDayPhD
@NicholasDayPhD 2 жыл бұрын
Thank you so much! You can find them with older C++ projects. Should be freely available on the internet.
@zenith_tetris
@zenith_tetris 2 жыл бұрын
Hey, where can I find the word document?
@Wolf-ts9gl
@Wolf-ts9gl Жыл бұрын
Does someone know where I can find the files "stdafx.h" and "targetver.h" ? I found them on Github but my IDE can't find the files afxwin.h, afxext.h, etc. Thanks for helping me...
@mersenne2486
@mersenne2486 Жыл бұрын
you don't need any of those you can run your programs without those
C++ Network Programming Part 2: TCP & UDP
1:02:10
Nicholas Day
Рет қаралды 31 М.
Support each other🤝
00:31
ISSEI / いっせい
Рет қаралды 81 МЛН
黑天使被操控了#short #angel #clown
00:40
Super Beauty team
Рет қаралды 61 МЛН
Enceinte et en Bazard: Les Chroniques du Nettoyage ! 🚽✨
00:21
Two More French
Рет қаралды 42 МЛН
The Linux socket API explained
15:21
Chris Kanich
Рет қаралды 42 М.
Networking in C++
32:50
The Cherno
Рет қаралды 270 М.
Emulating a CPU in C++ (6502)
52:28
Dave Poo
Рет қаралды 1 МЛН
31 nooby C++ habits you need to ditch
16:18
mCoding
Рет қаралды 867 М.
TCP/IP for Programmers
3:03:31
Eli the Computer Guy
Рет қаралды 269 М.
Making Minimalist Web Server in C on Linux
10:23
Nir Lichtman
Рет қаралды 263 М.
Let's Create a Compiler (Pt.1)
1:11:03
Pixeled
Рет қаралды 611 М.
Creating a TCP Server in C++
30:31
Sloan Kelly
Рет қаралды 328 М.
Support each other🤝
00:31
ISSEI / いっせい
Рет қаралды 81 МЛН