Multiple Chat Clients: One Thread (in C++)

preview_player
Показать описание
#networking #sockets #multipleclients #nothread

This is an introduction to network programming by building a server in C++ that echos the client's messages back. It allows multiple clients to connect using the fd_set structure, the select() function and three macros: FD_CLR, FD_SET and FD_ZERO

Рекомендации по теме
Комментарии
Автор

watching your videos I feel like I've taken a full year of school in just 10 minutes .#stupied_school_system

medjassertoubib
Автор

Excellent tutorial! Thanks for your time :)

EDemircivi
Автор

Well you managed to do a great job explaining select and how to handle multiple sockets on a server. I learned way more in 20 minutes from this video than from a few hours online. Thanks a ton

tmy
Автор

Very nice explication, im glad to find a video like that ! (u saved my project for my technical degree)

beauvisagecolin
Автор

you really explain perfectly what the book didnt explained well you did it!

DaniiTheFox
Автор

Thanks man, you are awesome at teaching :)

anlakkaya
Автор

no reason for me to not like this video. thumb up!

mucomplex
Автор

Very helpful! Ty. Also - are you Bahamian? And/or Canadian? Noticed the bill on the board and "CRA, Eh"

caseyli
Автор

Hello sir, I'm a relatively experienced programmer, and your networking series is great for me to get into C++ network programming. Thank you very much!

AvivCMusic
Автор

Thank you for your tutorial. Really useful and well described. By the way. You made a little mistake when you added a new bonus function \quit in your shared code. When you type \quit in putty, it returns "\quit\r\n" instead of "\quit". That's why you would never killed your server :) I have been investigating your code with debugger about hour and a half )) Sorry for my english. Thank you again. Nice job!

slimbdeful
Автор

This was super informative but I feel like I missed something. What does using select and associated macros etc buy me in this case that I can't do with a std::vector? Just seems like a list of fd's? Having not modified my code to try this yet ;), I feel like I'd just keep the listening socket out of the whole array as well...but maybe there is something with the flow where I need it?! We will see...thanks though! love learning this stuff

KFRogers
Автор

How to code it with linux & C++ ? Please teach me. Thank you.

thienthanhquach
Автор

Sloan your tutorials are excellent. Please do a multi client asynchronous server.

jamesmorrison
Автор

Great tutorial, man! I'm currently implementing a easy database like redis, and the communication between multiple clients and single server in windows is tough for me. This video really help me a lot. : )🥳

tiandizhong
Автор

Thank you for posting this. I'm currently working on an assignment similar to this and you have helped me so much and explained everything so well!

alexwilson
Автор

Thanks for doing this video ! Awesome stuff. Appreciate it.

xetop
Автор

Absolutely great tutorial, also very helpful that you subtly encouraged me to the debugging process. I recommend anyone to just hit a breakpoint and see what the 'select' function actually does each time you (disconnect, reconnect or send messages) from one of the clients.
For me, the confusion cleared up when I saw 'select' blocking the while loop for any activity and modifying the 'copy' fd set and the socketCount, to only include active sockets.
Thank you so much for this.

hemanta
Автор

That was just wonderful. Thank you very much.

QouteOfTheDay
Автор

Awesomeness! Always wondered what the FD stands for :-)
Will have to play with the select() function in order to see how it can handle client specific data! Thank you for the help!

raynopowell
Автор

You have no clue how happy this video made me. Thank you for taking the time to show this - really helped me understand things.

higheredjohn