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

แชร์
ฝัง
  • เผยแพร่เมื่อ 18 มิ.ย. 2017
  • #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
    Introduction to Networking, sockets and ports: • Introduction to Networ...
    The original video (C++) allowing one client to connect: • Creating a TCP Server ...
    Source code: github.com/codehoose/cpp-netw...
    You'll need PuTTY to test out the server. It can be downloaded from here: www.chiark.greenend.org.uk/~sg...

ความคิดเห็น • 281

  • @tmy6294
    @tmy6294 5 ปีที่แล้ว +13

    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

  • @nrncproductions
    @nrncproductions 6 ปีที่แล้ว

    Incredible stuff.Your explanation is so easy to understand.Great tutorial.Maybe the best winsock tutorial on TH-cam till now.Thx again.

  • @nipunramani
    @nipunramani 7 ปีที่แล้ว

    You are natural at teaching, thanks for these videos man they are of high quality.

  • @beauvisagecolin3567
    @beauvisagecolin3567 5 ปีที่แล้ว +7

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

  • @johnmccourt000
    @johnmccourt000 2 ปีที่แล้ว

    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.

  • @EDemircivi
    @EDemircivi 7 ปีที่แล้ว +28

    Excellent tutorial! Thanks for your time :)

  • @doylechrsitopherpete1323
    @doylechrsitopherpete1323 6 ปีที่แล้ว +1

    Easily the best video on this topic, explained so well

  • @tiandizhong6495
    @tiandizhong6495 2 ปีที่แล้ว +1

    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. : )🥳

  • @higheredjohn8316
    @higheredjohn8316 6 ปีที่แล้ว +2

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

    • @sloankelly
      @sloankelly  6 ปีที่แล้ว

      +Higher Ed John thanks!

  • @hemanta212
    @hemanta212 2 ปีที่แล้ว +1

    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.

  • @harshitmittal1217
    @harshitmittal1217 5 ปีที่แล้ว

    Oh God what a simple way of explanation.
    You are awesome man!!!

  • @jonforhan9196
    @jonforhan9196 ปีที่แล้ว

    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

  • @ColdBits
    @ColdBits 4 ปีที่แล้ว +6

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

  • @alexwilson8269
    @alexwilson8269 4 ปีที่แล้ว +2

    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!

    • @sloankelly
      @sloankelly  4 ปีที่แล้ว +1

      You're so welcome!

  • @raynopowell
    @raynopowell 6 ปีที่แล้ว +3

    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!

  • @xetop
    @xetop 6 ปีที่แล้ว +2

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

  • @medjassertoubib4467
    @medjassertoubib4467 6 ปีที่แล้ว +32

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

  • @QouteOfTheDay
    @QouteOfTheDay 5 ปีที่แล้ว +2

    That was just wonderful. Thank you very much.

  • @_xentropy
    @_xentropy 5 ปีที่แล้ว +1

    I needed this. Thanks for explaining!

  • @AvivCMusic
    @AvivCMusic 4 ปีที่แล้ว +3

    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!

  • @gastongp2011
    @gastongp2011 4 ปีที่แล้ว

    Excelent and practical video, thank you Mister.

  • @JonoJamesJonoJames
    @JonoJamesJonoJames 4 ปีที่แล้ว

    Thank you !! good tutorial and it was hard to find another comprehensive tutorial for multiple clients ...

    • @sloankelly
      @sloankelly  4 ปีที่แล้ว +1

      Glad it was helpful!

  • @user-po4nt6pf7l
    @user-po4nt6pf7l หลายเดือนก่อน

    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.

    • @sloankelly
      @sloankelly  หลายเดือนก่อน

      Thank you!!

  • @iamklevy
    @iamklevy 2 ปีที่แล้ว +1

    thanks man, we apreciate your work

  • @anlakkaya5511
    @anlakkaya5511 6 ปีที่แล้ว +2

    Thanks man, you are awesome at teaching :)

  • @simbarasheteveredzi9024
    @simbarasheteveredzi9024 2 ปีที่แล้ว

    Just finished the video it was very informative your a Legend, thank you.

  • @mytyang1248
    @mytyang1248 4 หลายเดือนก่อน

    Loved the vid, very well explained !

  • @tsraikage
    @tsraikage 5 ปีที่แล้ว +5

    you are my way to mmo game 😃 great lessons. thank you! keep doing videos, they are very detailed and also simply explained, good job

  • @KONTROLTECNOLOGIA
    @KONTROLTECNOLOGIA 3 ปีที่แล้ว

    Just amazing! I could finally finish my "daemon" - THANKS Much!!!

  • @jonf9989
    @jonf9989 4 ปีที่แล้ว

    You are a savior man.. truly amazing.. thanks

  • @madhusudhanreddy4932
    @madhusudhanreddy4932 5 ปีที่แล้ว +2

    Thank you soo much this helped me a lot

  • @DogeCharger
    @DogeCharger 3 ปีที่แล้ว +5

    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!

  • @edenr1988
    @edenr1988 5 ปีที่แล้ว

    good job! really liked your tutorial, please keep it up ! :)

  • @tehviganotti
    @tehviganotti 7 ปีที่แล้ว +5

    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

    • @darkman237
      @darkman237 7 ปีที่แล้ว +3

      He is awesome! :-)

  • @sonar_devices
    @sonar_devices 4 ปีที่แล้ว

    Thank you so much. Hello from Belarus )

  • @IgorAherne
    @IgorAherne 7 ปีที่แล้ว +4

    Learning new stuff! :DD

  • @user-co6te9dz4l
    @user-co6te9dz4l 6 ปีที่แล้ว +1

    You are THE BEST!!!!!! Thank you so much!!!

    • @sloankelly
      @sloankelly  6 ปีที่แล้ว

      +Николай Лебедев thank you :)

  • @machrvon
    @machrvon 5 ปีที่แล้ว +1

    thank you alot for your tutorial.

  • @patrickhawking4655
    @patrickhawking4655 2 ปีที่แล้ว

    Best channel! No Water, really good

    • @sloankelly
      @sloankelly  2 ปีที่แล้ว

      Glad you enjoy it!

  • @jhonycaicedomora3534
    @jhonycaicedomora3534 6 ปีที่แล้ว +1

    Good video many thanks.

  • @quanphamanh957
    @quanphamanh957 2 ปีที่แล้ว

    thank you for this video!

  • @tobiaslarsson8206
    @tobiaslarsson8206 ปีที่แล้ว

    Thank you very much, excellent video! Now I just hope my project don't end up needing multi threading.... 🙂

  • @andresrobertotulcan6935
    @andresrobertotulcan6935 2 ปีที่แล้ว +1

    Great job

  • @slimbdeful
    @slimbdeful 6 ปีที่แล้ว +2

    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!

    • @sloankelly
      @sloankelly  6 ปีที่แล้ว

      D'oh! Thanks for debugging and posting what you found!

  • @ed_iz_ed
    @ed_iz_ed 5 ปีที่แล้ว

    Awesome vid, haha looks like someones been working with threads

  • @caseyli5580
    @caseyli5580 6 ปีที่แล้ว +1

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

    • @sloankelly
      @sloankelly  6 ปีที่แล้ว +2

      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.

  • @zhivkonushev6165
    @zhivkonushev6165 3 ปีที่แล้ว

    I definitely liked the video

  • @hichamwarryor3547
    @hichamwarryor3547 2 ปีที่แล้ว +1

    Thank you sir

  • @kolyan199816
    @kolyan199816 6 ปีที่แล้ว

    Exellent! Very cool lesson.But I want more theory, because you vary interesting explain. Please, make more tutorials about server and client.

    • @sloankelly
      @sloankelly  6 ปีที่แล้ว

      +Николай Городецкий thank you :) feel free to check out the other videos in this playlist. Networking in C++: th-cam.com/play/PLZo2FfoMkJeEogzRXEJeTb3xpA2RAzwCZ.html

  • @jamesmorrison4713
    @jamesmorrison4713 6 ปีที่แล้ว

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

    • @sloankelly
      @sloankelly  6 ปีที่แล้ว +1

      Thanks :) I'm working on more networking tutorial ideas, but I don't have an ETA when I'll start recording them.

  • @krizanfil
    @krizanfil 3 ปีที่แล้ว +1

    great vid! thanks!

  • @MudHoleCreation
    @MudHoleCreation 6 ปีที่แล้ว +1

    Awesome job man

  • @SisirKumarPathy
    @SisirKumarPathy 4 ปีที่แล้ว

    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.

  • @manjoos4906
    @manjoos4906 3 ปีที่แล้ว +1

    this is amazing, thanks :DDDD)))

  • @kamc6322
    @kamc6322 5 ปีที่แล้ว

    Excellent video!!!
    can you please make a video if there was a client.cpp sending a dynamic data to the server.
    how should i handle the hand, data(dynamic) and tail
    entire package struct to the server

  • @ivanypinheiro6410
    @ivanypinheiro6410 3 หลายเดือนก่อน

    finally i get it! Thank you!

    • @sloankelly
      @sloankelly  3 หลายเดือนก่อน

      Thank you!

  • @DobyS100
    @DobyS100 6 ปีที่แล้ว +1

    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

    • @sloankelly
      @sloankelly  6 ปีที่แล้ว

      Sounds like a good idea. Ok!

  • @nsgirish
    @nsgirish 6 ปีที่แล้ว

    Excellent video sir :)

    • @sloankelly
      @sloankelly  6 ปีที่แล้ว +1

      +Ns Girish thanks!

  • @bobjime510
    @bobjime510 5 ปีที่แล้ว +1

    thank you bro

  • @alexanderbalasky6174
    @alexanderbalasky6174 3 ปีที่แล้ว

    Awesome content

  • @fastermanable
    @fastermanable 6 ปีที่แล้ว

    Nice Vid ;
    Learning new= stuff;

  • @huy9251
    @huy9251 3 ปีที่แล้ว

    very nice

  • @quanghong3922
    @quanghong3922 5 ปีที่แล้ว

    Good Job

  • @ganaa72001
    @ganaa72001 7 ปีที่แล้ว +1

    well, good job, when next part?

  • @maivutuyet3101
    @maivutuyet3101 6 ปีที่แล้ว

    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!

    • @sloankelly
      @sloankelly  6 ปีที่แล้ว

      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.

  • @deadoptick01
    @deadoptick01 6 ปีที่แล้ว

    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.

  • @WeskerPower
    @WeskerPower 4 ปีที่แล้ว +1

    nice videos man

  • @nitroneonicman
    @nitroneonicman 5 ปีที่แล้ว

    You're the boss.

  • @user-vu2vz5pk5m
    @user-vu2vz5pk5m 4 ปีที่แล้ว +1

    amazing

  • @ButIfWeSurvive-WeHereInTheEnd
    @ButIfWeSurvive-WeHereInTheEnd 2 ปีที่แล้ว

    YOU NUMBER 1!

  • @Bakuta1103
    @Bakuta1103 5 ปีที่แล้ว

    Any recommendations for learning about multithreaded chat server?

  • @jscientista
    @jscientista 6 ปีที่แล้ว

    Your videos are very good, I learn a lot. if you allow me, do you have some kind of video that teaches you to create a service in the WCF, REST, WebAPI?

    • @sloankelly
      @sloankelly  6 ปีที่แล้ว

      +Julio Castro I don't at the moment. But accessing RESTful services is something I have in my idea hopper.

  • @user-hg1mn3qo8x
    @user-hg1mn3qo8x 2 ปีที่แล้ว

    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?

    • @sloankelly
      @sloankelly  2 ปีที่แล้ว

      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

  • @rambergush1569
    @rambergush1569 3 ปีที่แล้ว +1

    Genius

  • @dharamgyaani
    @dharamgyaani 4 ปีที่แล้ว +1

    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

  • @elisal8693
    @elisal8693 4 ปีที่แล้ว +2

    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.

    • @GhostJerry
      @GhostJerry 4 ปีที่แล้ว

      Me too, the BareBone Client doesnt work at all

    • @talhazaigham3575
      @talhazaigham3575 2 ปีที่แล้ว

      @@GhostJerry did u guys find a solution?

  • @gnewb9658
    @gnewb9658 3 ปีที่แล้ว

    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.)

    • @sloankelly
      @sloankelly  3 ปีที่แล้ว

      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.

    • @gnewb9658
      @gnewb9658 3 ปีที่แล้ว +1

      @@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!

  • @aqibj76
    @aqibj76 6 ปีที่แล้ว

    I want to ask that how to open a new xterminal using C++ command in coding section?

  • @armanaghilipour
    @armanaghilipour 6 ปีที่แล้ว

    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 ()

    • @sloankelly
      @sloankelly  6 ปีที่แล้ว

      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: th-cam.com/video/0Zr_0Jy8mWE/w-d-xo.html

  • @tanayabhave859
    @tanayabhave859 3 ปีที่แล้ว

    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++

    • @sloankelly
      @sloankelly  3 ปีที่แล้ว

      Yes! Beej’s networking guide beej.us/guide/bgnet/

    • @tanayabhave859
      @tanayabhave859 3 ปีที่แล้ว +1

      @@sloankelly Thank you !

  • @medjassertoubib4467
    @medjassertoubib4467 6 ปีที่แล้ว

    whitch is best for server .windows or linux? and thx

  • @gelding
    @gelding 4 ปีที่แล้ว

    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?

  • @raspberrypi1848
    @raspberrypi1848 2 ปีที่แล้ว

    MASTER!

  • @cmdrgarbage1895
    @cmdrgarbage1895 4 ปีที่แล้ว

    Can you make this work with the client c++ program you've written?

  • @mucomplex9115
    @mucomplex9115 3 ปีที่แล้ว +1

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

  • @Nicolas-ch6ft
    @Nicolas-ch6ft 5 ปีที่แล้ว

    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

  • @sourav9135
    @sourav9135 2 ปีที่แล้ว

    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++

  • @rishabhmalhotra2225
    @rishabhmalhotra2225 4 ปีที่แล้ว

    Please demonstrate on how to use putty.

  • @samuelesarti3271
    @samuelesarti3271 6 ปีที่แล้ว

    hi, thank u for the video, it was really usefull, but I' ve a problem:
    if I do not want to use PuTTY, how can i create the client?

    • @sloankelly
      @sloankelly  6 ปีที่แล้ว

      I have a video for that! th-cam.com/video/0Zr_0Jy8mWE/w-d-xo.html
      It's a basic into and it does have a drawback that is mentioned in the comments section of this video. It doesn't auto update messages from other clients. However, someone did post a solution below!

  • @elkaseralkobra294
    @elkaseralkobra294 6 ปีที่แล้ว

    I used the same idea to send to every client that connected to the server a Msg . but when I use putty from another device to test if it work on internet . it doesn't connect to the server

    • @sloankelly
      @sloankelly  6 ปีที่แล้ว

      You might need to open the port on your firewall. Are you connecting to the server over the internet, or just your local network? If you're trying to connect over the internet, it probably won't work because your internet provider won't allow you to do so.

  • @JovianCasius
    @JovianCasius 5 ปีที่แล้ว +1

    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 ?

    • @sloankelly
      @sloankelly  5 ปีที่แล้ว +1

      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.

    • @JovianCasius
      @JovianCasius 5 ปีที่แล้ว

      I see, thanks sir !

  • @bamsgian9759
    @bamsgian9759 3 ปีที่แล้ว

    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?

    • @sloankelly
      @sloankelly  3 ปีที่แล้ว +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.

  • @robertjarrell3105
    @robertjarrell3105 3 ปีที่แล้ว

    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

  • @tedp9146
    @tedp9146 4 ปีที่แล้ว

    Can you please do the exact thing for linux too?

  • @thienthanhquach8270
    @thienthanhquach8270 4 ปีที่แล้ว +2

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

    • @wanderingpalace
      @wanderingpalace 2 ปีที่แล้ว

      Ifdef WIN32
      do windows stuff
      Else
      Do Linux stuff
      Endif
      Repeat this for every function that concerns compatability

  • @naoryehuda6830
    @naoryehuda6830 3 ปีที่แล้ว

    why do we loop on return value of select? shouldn't we run on
    copy.fd_count?

  • @robvanspaandonk
    @robvanspaandonk 5 ปีที่แล้ว

    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

    • @sloankelly
      @sloankelly  5 ปีที่แล้ว

      Are you trying to run this under UN*X?

  • @HassaanALal
    @HassaanALal 5 ปีที่แล้ว +1

    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.

    • @sloankelly
      @sloankelly  5 ปีที่แล้ว +1

      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] th-cam.com/video/cNdlrbZSkyQ/w-d-xo.html replace SOCKET with int and don’t do the winsock code. Everything else is the same. select() will work too.

    • @HassaanALal
      @HassaanALal 5 ปีที่แล้ว

      @@sloankelly thanks sloan!

  • @PedroDias-nw6zr
    @PedroDias-nw6zr 4 ปีที่แล้ว

    YOU ARE A FUCKING GOD, BRAZIL LOVES YOU MAN S2

  • @Mrboxdude123
    @Mrboxdude123 7 ปีที่แล้ว

    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]

    • @Mrboxdude123
      @Mrboxdude123 7 ปีที่แล้ว

      really great tutorial tho, very easy to follow

    • @Mrboxdude123
      @Mrboxdude123 7 ปีที่แล้ว

      never mind all fixed :)