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
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!
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.
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!
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. : )🥳
23:01 can confirm, this is an accurate interaction This tutorial is definitely helpful for C++ networking and one of the better-explained ones too - thank you!
Hi. Thanks for this video. You did a really good job of explaining fd_set. I've been learning sockets so I can try to fix a racing game from the 1990s. These videos have been crucial to getting the server side rewritten. I'm moving it from udp connections between every single client in a race to a central tcp server so that users don't have to have port forwarding/holepunching or directly connect to all the other users in the race.
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
Thanks a lot for the video and the time you invest in it, i hope you're going to continue this serie on c++ and others aswell, imo very interesting content, deep but understandable explanation and you're good at teaching
Great tutorial! I tried to make reading only server switch between multiple nonblocking udp sockets but in my case i want to bind udp-es on one port only. Which approach works for udp sockets , because they can'be bind to one port and select function does not take sockaddr_in argument to switch between users IP-es?
Thank you! You can bind UDP sockets. I updated the code to use UDP instead of TCP: github.com/codehoose/cpp-networking/blob/e803aa73141947951ef88e27d208a348d9d4f78a/MultipleClientsBarebonesServerUDP/MultipleClientsBarebonesServer/main.cpp#L24 Creates the UDP socket and github.com/codehoose/cpp-networking/blob/e803aa73141947951ef88e27d208a348d9d4f78a/MultipleClientsBarebonesServerUDP/MultipleClientsBarebonesServer/main.cpp#L37 binds it to the port # This section of code uses recvfrom() to read the incoming data from the UDP client: github.com/codehoose/cpp-networking/blob/e803aa73141947951ef88e27d208a348d9d4f78a/MultipleClientsBarebonesServerUDP/MultipleClientsBarebonesServer/main.cpp#L84-L88
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 " 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!
Hello @Sloan, your video is very awesome but i have a question for you. you use FD function to connect the clients to server, i think it is seem to array which have listen and clients. But if 2 or more client send message together, how to it work? I used C# make the multiple chat app, and it use "thread", it divide some threads which handle clients at the same time. If you don't use "thread", maybe it happens lag, lead to "Not Responding" to server. Thank you!
When data is received it fills up a buffer inside WinSock. The recv() function is used to read that buffer and place the contents in your program's local memory (that 'buf' variable). If there's nothing in the buffer, recv() blocks, that's why we use those FD_XXX macros, to test if there is data waiting. If there's no data, recv() isn't called and the program doesn't block. All of this means that you can have multiple clients connected to a server running a single thread. Now, you may want to NOT have a single process for your server, for whatever reason, but this example shows that for quick message passing this may be a viable solution for your problem without resorting to multiple threads / processes / servers etc.
Hello, I am coding under macOS so I can't use the library WinSock... I replaced SOCKET by int but I have an issue with .fd_array and .fd_count Here is the problem "No member named 'fd_array' in 'fd_set'" and "No member named 'fd_count' in 'fd_set'" Do you have a solution? Thank you very much
Hello Mr. Kelly, I have watched multiple of your videos, two on creating a TCP server (one winsock and one linux) and now this one on creating chat clients. I am doing my own practice using vscode on a mac. I was wondering, are you familiar with Boost asio library? It seems, from the information i've gathered, this library is quite common in c++ networking. Does the Boost/asio library effectively replace those libraries chosen by you in this video and the TCP server video (Sockets libraries, etc.)
I’m aware that it exists, but I haven’t used it. I was teaching a college course on socket programming and I decided to make videos around winsock. There’s definitely a good reason to use things like the Boost library, but I wanted to let people understand what’s under the hood.
@@sloankelly Absolutely, it definitely helped me understand all the steps it takes to create a socket and establish a connection. Thanks for responding and making such informative videos!
+Николай Городецкий thank you :) feel free to check out the other videos in this playlist. Networking in C++: ua-cam.com/play/PLZo2FfoMkJeEogzRXEJeTb3xpA2RAzwCZ.html
Canadian :) We were in the Bahamas on holiday and I got the bill as part of my change. The CRA, Eh? thing is a reference to the Family Guy episode when they pass though Canada to get to the North Pole.
Hi. Thank you for your videos. It's appreciated. But I wonder if Putty uses send() twice when I press enter? Because I need to use recv() twice to get all bytes. (Once for the message I've written in putty, and once for 2 bytes of nothing. Maybe it's a newline?) I tested this by sending a message from Putty BEFORE the server had reached the function recv(). This time, it was enough to use recv () only once. I suppose everything from Putty had time to come in this time before I used recv ()
PuTTY seems to send the separetly, and I don't know why. You can use the barebones client to send messages though. Video is here: ua-cam.com/video/0Zr_0Jy8mWE/v-deo.html
Really should have moved these from bitbucket long ago. Done now! Full source is at github.com/codehoose/cpp-networking/tree/main/MultipleClientsBarebonesServer.
Hi, how could I make the barebones clients from your other video receive and send to the server at the same time, I've trying for a while but I just can't get it right.
hi sir, nice video, learn a lot from here , but can i ask you a question about how do you make client 1 chat and then client 1 can chat client 2 again without waiting client 2 to response just like every chatting app do ?
The server gets data sent to it from each client. This data is held in a buffer until the server calls the recv() function. By using the select() function we can wait until a message has been placed in the buffer before calling recv(). When a message has been received it is broadcast to every other client, except the one that sent the original message. The clients use something similar in their code. This allows them to receive and respond at the same time.
This is video is really nice. Will it be possible for you to create a video on "multiple clients using windows IOCP"? I am trying to learn this but having a lot difficulties to understand the concept.
Hello, program works fine, but when my friend tries to connect to the server it does not work for him. Although when I open multiple instances of PuTTY it works fine for me. Any idea why my friend does not see the chat or the welcoming message?
I wonder how looping after select works, if I have 3 connection and loops now works on connection #2 then I got message from client #1 at the same time as loop state is on connection #2. Did I still got message from connection #1?
The messages are received into a buffer and read as if they were a stream and so any messages that you 'miss' will be available the next time you call recv() on that socket.
Thank you for your videos. I am new to networking and have found your videos to be very useful. Is there a book you can recommend for me to study from for networking in C++
The master file descriptor set isn’t touched. The copy contains the listener and any previously connected clients. If none of the clients are sending a message when select() is called they’d be remove from copy. This is because the select() command only returns socket IDs that have some activity on them.
Copy is a copy of master, we don’t want to change master because we wouldn’t know what sockets had connected because we’d lose them after the select().
how many clients it can connect upto,as i know the fd_set array size of 64 (it is configurable but i don't want to) ,means I want to know how it gonna behave
Id keep tabs on the number of clients connecting / disconnecting and if it matches the max, send a “server full” type message to the client and close the new connection.
what if i have to handle large number of clients then?,i thought some soutions like ,create a class based on server and client and keep each fd_Set for each client object,will it work,what your point on this, or any other architecture which u'd like to suggest.@@sloankelly
Most companies use multiple servers and some kind of load balancing to distribute the traffic. You probably want to set an upper limit on the amount of clients you have based on the machine's resources; RAM, CPU, etc. It also depends on how much processing you're doing per client. How much traffic are they sending to you, how much are you returning?
I dont know if the select function change but now if you want the select function to dont block the thread you need to create a timeval variable fill it in by the time you want him to block and put it at the last parameter of the select function ortherwise if you put null or 0 it will block the thread.
hi, I've been having a bit of a problem, because in order to call the fd_sets, etc, I've had to make them all pointers, and now it isn't letting me declare SOCKET Sock = copy.fd_array[i]
can't access fd_array[i] from the object copy of fd_set would be really grateful for the help. The members of the structure fd_set are not accessible. Please help. Coding in ubuntu's text editor. The compiler does not recognize the members of the structure despite the use of headers and the other required libraries.
I'll take a look at this at the weekend and let you know what I find. I haven't done much networking under Linux, some things are not in the same headers as under Windows.
So I guess what you mean is no threading on the server right? Because when I use 2 PCs I obviously have 2 separate threads so that wouldnt make sense to me
How to do this in Linux? I know it hurts but my professor want it in linux. There's no WinSock lib on linux so we have to use linux socket libs (sys). I am converting the code for linux, I hope it will work. And will try telnet for clients.
I haven’t converted this project over yet, but you can use this video to do that: Creating a TCP Server in C++ [Linux / Code Blocks] ua-cam.com/video/cNdlrbZSkyQ/v-deo.html replace SOCKET with int and don’t do the winsock code. Everything else is the same. select() will work too.
Great tutorial , thanks ! I was wondering if you could show us how to implement a vector so that as soon as you run the program, names would appear instead of Socket numbers . Thank you
Yes. It’s in but I don’t recommend it. It’s also way beyond the scope of this video to cover it. You can look up things like port forwarding and NAT as a starting point to open up your server to the outside. It is a DEFINITE security risk doing so. And I HIGHLY RECOMMEND you don’t attempt it. Especially if you’re just learning about writing client/server applications.
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
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!
Thanks!
I hope you know how much I appreciate you. I'm self taught developer learned C++ and now this opens so many doors for me, I owe you one man
you really explain perfectly what the book didnt explained well you did it!
You have no clue how happy this video made me. Thank you for taking the time to show this - really helped me understand things.
+Higher Ed John thanks!
watching your videos I feel like I've taken a full year of school in just 10 minutes .#stupied_school_system
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.
Very nice explication, im glad to find a video like that ! (u saved my project for my technical degree)
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!
File Descriptor.
Mazda FD is a car
God bless you. it's the best tutorial channel that i ever saw in entire internet. you explain better than courses that i pay for.
Thank you!!
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. : )🥳
23:01
can confirm, this is an accurate interaction
This tutorial is definitely helpful for C++ networking and one of the better-explained ones too - thank you!
Hi. Thanks for this video. You did a really good job of explaining fd_set. I've been learning sockets so I can try to fix a racing game from the 1990s. These videos have been crucial to getting the server side rewritten. I'm moving it from udp connections between every single client in a race to a central tcp server so that users don't have to have port forwarding/holepunching or directly connect to all the other users in the race.
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!
You're so welcome!
Excellent tutorial! Thanks for your time :)
Oh God what a simple way of explanation.
You are awesome man!!!
You are natural at teaching, thanks for these videos man they are of high quality.
Thank you !! good tutorial and it was hard to find another comprehensive tutorial for multiple clients ...
Glad it was helpful!
Easily the best video on this topic, explained so well
thanks man, we apreciate your work
you are my way to mmo game 😃 great lessons. thank you! keep doing videos, they are very detailed and also simply explained, good job
Incredible stuff.Your explanation is so easy to understand.Great tutorial.Maybe the best winsock tutorial on UA-cam till now.Thx again.
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
Thanks a lot for the video and the time you invest in it, i hope you're going to continue this serie on c++ and others aswell, imo very interesting content, deep but understandable explanation and you're good at teaching
He is awesome! :-)
Best channel! No Water, really good
Glad you enjoy it!
Thank you very much, excellent video! Now I just hope my project don't end up needing multi threading.... 🙂
Great tutorial! I tried to make reading only server switch between multiple nonblocking udp sockets but in my case i want to bind udp-es on one port only. Which approach works for udp sockets , because they can'be bind to one port and select function does not take sockaddr_in argument to switch between users IP-es?
Thank you! You can bind UDP sockets. I updated the code to use UDP instead of TCP:
github.com/codehoose/cpp-networking/blob/e803aa73141947951ef88e27d208a348d9d4f78a/MultipleClientsBarebonesServerUDP/MultipleClientsBarebonesServer/main.cpp#L24 Creates the UDP socket and github.com/codehoose/cpp-networking/blob/e803aa73141947951ef88e27d208a348d9d4f78a/MultipleClientsBarebonesServerUDP/MultipleClientsBarebonesServer/main.cpp#L37 binds it to the port #
This section of code uses recvfrom() to read the incoming data from the UDP client:
github.com/codehoose/cpp-networking/blob/e803aa73141947951ef88e27d208a348d9d4f78a/MultipleClientsBarebonesServerUDP/MultipleClientsBarebonesServer/main.cpp#L84-L88
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
" 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!
D'oh! Thanks for debugging and posting what you found!
Excelent and practical video, thank you Mister.
Hello @Sloan, your video is very awesome but i have a question for you. you use FD function to connect the clients to server, i think it is seem to array which have listen and clients. But if 2 or more client send message together, how to it work? I used C# make the multiple chat app, and it use "thread", it divide some threads which handle clients at the same time. If you don't use "thread", maybe it happens lag, lead to "Not Responding" to server. Thank you!
When data is received it fills up a buffer inside WinSock. The recv() function is used to read that buffer and place the contents in your program's local memory (that 'buf' variable). If there's nothing in the buffer, recv() blocks, that's why we use those FD_XXX macros, to test if there is data waiting. If there's no data, recv() isn't called and the program doesn't block. All of this means that you can have multiple clients connected to a server running a single thread.
Now, you may want to NOT have a single process for your server, for whatever reason, but this example shows that for quick message passing this may be a viable solution for your problem without resorting to multiple threads / processes / servers etc.
Just amazing! I could finally finish my "daemon" - THANKS Much!!!
Just finished the video it was very informative your a Legend, thank you.
Thanks for doing this video ! Awesome stuff. Appreciate it.
Sloan your tutorials are excellent. Please do a multi client asynchronous server.
Thanks :) I'm working on more networking tutorial ideas, but I don't have an ETA when I'll start recording them.
Thank you so much. Hello from Belarus )
That was just wonderful. Thank you very much.
I needed this. Thanks for explaining!
Loved the vid, very well explained !
You are a savior man.. truly amazing.. thanks
Thank you sir
You given me my answers thanks
Thanks man, you are awesome at teaching :)
Great job
Hello, I am coding under macOS so I can't use the library WinSock... I replaced SOCKET by int but I have an issue with .fd_array and .fd_count
Here is the problem "No member named 'fd_array' in 'fd_set'" and "No member named 'fd_count' in 'fd_set'"
Do you have a solution?
Thank you very much
Hello Mr. Kelly,
I have watched multiple of your videos, two on creating a TCP server (one winsock and one linux) and now this one on creating chat clients.
I am doing my own practice using vscode on a mac. I was wondering, are you familiar with Boost asio library? It seems, from the information i've gathered, this library is quite common in c++ networking. Does the Boost/asio library effectively replace those libraries chosen by you in this video and the TCP server video (Sockets libraries, etc.)
I’m aware that it exists, but I haven’t used it. I was teaching a college course on socket programming and I decided to make videos around winsock.
There’s definitely a good reason to use things like the Boost library, but I wanted to let people understand what’s under the hood.
@@sloankelly Absolutely, it definitely helped me understand all the steps it takes to create a socket and establish a connection.
Thanks for responding and making such informative videos!
Learning new stuff! :DD
why do we loop on return value of select? shouldn't we run on
copy.fd_count?
You could.
How can I make a code for client what changes Do I have to make in the code that you teach in A video named Creating TCP client in C++
Exellent! Very cool lesson.But I want more theory, because you vary interesting explain. Please, make more tutorials about server and client.
+Николай Городецкий thank you :) feel free to check out the other videos in this playlist. Networking in C++: ua-cam.com/play/PLZo2FfoMkJeEogzRXEJeTb3xpA2RAzwCZ.html
sir can you provide a way to connect multiple clients to a single server without using putty, I mean just by making clients in visual studio itself
Very helpful! Ty. Also - are you Bahamian? And/or Canadian? Noticed the bill on the board and "CRA, Eh"
Canadian :) We were in the Bahamas on holiday and I got the bill as part of my change. The CRA, Eh? thing is a reference to the Family Guy episode when they pass though Canada to get to the North Pole.
You are THE BEST!!!!!! Thank you so much!!!
+Николай Лебедев thank you :)
Hi. Thank you for your videos. It's appreciated. But I wonder if Putty uses send() twice when I press enter? Because I need to use recv() twice to get all bytes. (Once for the message I've written in putty, and once for 2 bytes of nothing. Maybe it's a newline?)
I tested this by sending a message from Putty BEFORE the server had reached the function recv(). This time, it was enough to use recv () only once. I suppose everything from Putty had time to come in this time before I used recv ()
PuTTY seems to send the
separetly, and I don't know why. You can use the barebones client to send messages though. Video is here: ua-cam.com/video/0Zr_0Jy8mWE/v-deo.html
i copied the code but Putty keep exiting saying erro and i don't know why it work for the originally tcp server but not working for this one
I definitely liked the video
thank you for this video!
Aside bitbucket where else can I get the code. I am having difficulties downloading it from there
Really should have moved these from bitbucket long ago. Done now! Full source is at github.com/codehoose/cpp-networking/tree/main/MultipleClientsBarebonesServer.
Hi, how could I make the barebones clients from your other video receive and send to the server at the same time, I've trying for a while but I just can't get it right.
Me too, the BareBone Client doesnt work at all
@@GhostJerry did u guys find a solution?
Awesome job man
YOU NUMBER 1!
thank you alot for your tutorial.
Any recommendations for learning about multithreaded chat server?
finally i get it! Thank you!
Thank you!
great vid! thanks!
hi sir, nice video, learn a lot from here , but can i ask you a question about how do you make client 1 chat and then client 1 can chat client 2 again without waiting client 2 to response just like every chatting app do ?
The server gets data sent to it from each client. This data is held in a buffer until the server calls the recv() function.
By using the select() function we can wait until a message has been placed in the buffer before calling recv().
When a message has been received it is broadcast to every other client, except the one that sent the original message.
The clients use something similar in their code. This allows them to receive and respond at the same time.
I see, thanks sir !
This is video is really nice. Will it be possible for you to create a video on "multiple clients using windows IOCP"? I am trying to learn this but having a lot difficulties to understand the concept.
Thank you soo much this helped me a lot
How to code it with linux & C++ ? Please teach me. Thank you.
Ifdef WIN32
do windows stuff
Else
Do Linux stuff
Endif
Repeat this for every function that concerns compatability
Hello, program works fine, but when my friend tries to connect to the server it does not work for him. Although when I open multiple instances of PuTTY it works fine for me. Any idea why my friend does not see the chat or the welcoming message?
I wonder how looping after select works, if I have 3 connection and loops now works on connection #2 then I got message from client #1 at the same time as loop state is on connection #2. Did I still got message from connection #1?
The messages are received into a buffer and read as if they were a stream and so any messages that you 'miss' will be available the next time you call recv() on that socket.
no reason for me to not like this video. thumb up!
Thank you for your videos. I am new to networking and have found your videos to be very useful. Is there a book you can recommend for me to study from for networking in C++
Yes! Beej’s networking guide beej.us/guide/bgnet/
@@sloankelly Thank you !
I want to ask that how to open a new xterminal using C++ command in coding section?
Good video many thanks.
good job! really liked your tutorial, please keep it up ! :)
Can you make this work with the client c++ program you've written?
if select destoys fd_set, so why are we looping in copy?
doesn't copy destroyed by select?
The master file descriptor set isn’t touched. The copy contains the listener and any previously connected clients. If none of the clients are sending a message when select() is called they’d be remove from copy. This is because the select() command only returns socket IDs that have some activity on them.
After select copy contains the list of sockets that have either a new connection (the listening socket) or a message being received from a client.
Copy is a copy of master, we don’t want to change master because we wouldn’t know what sockets had connected because we’d lose them after the select().
how many clients it can connect upto,as i know the fd_set array size of 64 (it is configurable but i don't want to) ,means I want to know how it gonna behave
Id keep tabs on the number of clients connecting / disconnecting and if it matches the max, send a “server full” type message to the client and close the new connection.
what if i have to handle large number of clients then?,i thought some soutions like ,create a class based on server and client and keep each fd_Set for each client object,will it work,what your point on this, or any other architecture which u'd like to suggest.@@sloankelly
Most companies use multiple servers and some kind of load balancing to distribute the traffic. You probably want to set an upper limit on the amount of clients you have based on the machine's resources; RAM, CPU, etc. It also depends on how much processing you're doing per client. How much traffic are they sending to you, how much are you returning?
Please demonstrate on how to use putty.
Genius
You're the boss.
i get this error when i make ‘struct fd_set’ has no member named ‘fd_array’ at the line copy.fd_array[i]; does anyone know how to fix this
Are you trying to run this under UN*X?
Awesome content
this is amazing, thanks :DDDD)))
Awesome vid, haha looks like someones been working with threads
I dont know if the select function change but now if you want the select function to dont block the thread you need to create a timeval variable fill it in by the time you want him to block and put it at the last parameter of the select function ortherwise if you put null or 0 it will block the thread.
The epoll method is more efficient, is it not? Wouldn't it be better to scrap "select" and just encourage everyone to use epoll?
It might be? :) I was sticking to the POSIX functions, and using Windows as well. epoll is Linux only..?
well, good job, when next part?
hi, I've been having a bit of a problem, because in order to call the fd_sets, etc, I've had to make them all pointers, and now it isn't letting me declare SOCKET Sock = copy.fd_array[i]
really great tutorial tho, very easy to follow
never mind all fixed :)
can't access fd_array[i] from the object copy of fd_set
would be really grateful for the help. The members of the structure fd_set are not accessible. Please help. Coding in ubuntu's text editor. The compiler does not recognize the members of the structure despite the use of headers and the other required libraries.
I'll take a look at this at the weekend and let you know what I find. I haven't done much networking under Linux, some things are not in the same headers as under Windows.
Thanks a lot, Sir!! Very grateful!!!
@@sloankelly Sir, did you find anything??
As to why we cannot access members of struct fd_set in linux g++ compiler?
Do you have #include at the top of your code?
Yes, Sir.
nice videos man
So I guess what you mean is no threading on the server right? Because when I use 2 PCs I obviously have 2 separate threads so that wouldnt make sense to me
That’s right, yes. A single thread on the server. Multi-threaded tends to mean multiple threads on the same machine.
very nice
thank you bro
How to do this in Linux? I know it hurts but my professor want it in linux. There's no WinSock lib on linux so we have to use linux socket libs (sys). I am converting the code for linux, I hope it will work. And will try telnet for clients.
I haven’t converted this project over yet, but you can use this video to do that: Creating a TCP Server in C++ [Linux / Code Blocks] ua-cam.com/video/cNdlrbZSkyQ/v-deo.html replace SOCKET with int and don’t do the winsock code. Everything else is the same. select() will work too.
@@sloankelly thanks sloan!
Great tutorial , thanks ! I was wondering if you could show us how to implement a vector so that as soon as you run the program, names would appear instead of Socket numbers . Thank you
Sounds like a good idea. Ok!
My putty client connects but doesnt get the message.
Make sure it’s set to “raw”
Why does the server not let other client on my WiFi Connect ?? Isn't it possible to make it public for anyone that's not on my WiFi to do so ?
Yes. It’s in but I don’t recommend it. It’s also way beyond the scope of this video to cover it. You can look up things like port forwarding and NAT as a starting point to open up your server to the outside. It is a DEFINITE security risk doing so. And I HIGHLY RECOMMEND you don’t attempt it. Especially if you’re just learning about writing client/server applications.
@@sloankelly I won't be sharing my ip with anyone And when it works Windows is hidden.
amazing
Excellent video sir :)
+Ns Girish thanks!