A note that Jacob didn't address: select() is slow. It takes linear time with the amount of sockets to monitor. That's a limitation of the kernel, so there's nothing we can do about it. That's why there are more modern replacements (epoll, kqueues) which are much more efficient, in addition to offer more events than select does.
Nice! Beautifully explained. Please continue on select() to handle multiple clients and how to read() multiple times.
who could have possibly disliked this gem?
this is in the realm of personal lessons. kids... u better pray you have a teacher this good. u sir are awesum.
I have made the switch to linux so now i am watching all of your videos again
thank you for this, was able to use it to monitor serial ports and not hang on a read function.
I really like your videos. They are short and informative. You get right to the point.
I have a humble request for you, it will be really awesome if we can have a Playlist from beginner to advance level or a paid course in C. Please create a course on C 🙏🙏
Love watching your videos because you're an expert on everything you talk about
Hi Jacob I think there is an error. The max_socket_so_far in "select" function should be if(select(max_socket_so_far + 1, &ready_sockets, NULL, NULL, NULL) < 0) . I'm currently implementing a voice assistant application using PI (school project). Thanks for all your efforts you saved me lot of time for handling multiple clients 👍👍👍.
Hey, surprised to see you using select() instead of poll() and not even mentioning poll() and its advantages over select() As you can see select is not very scalable (and not only because of the fd limit), also, its API is a bit cumbersome. It's true that select is widely implemented, but nowadays you'll be able to use poll() on pretty much all machines as well, and if it's a Linux machine then chances are you can use improved versions of poll. Overall poll gets the same job done better and easier. Many argue that select should not be used at all as it's outdated. Descriptor multiplexers aside, I'd like to thank you for your multithreading and socket videos, they helped me tremendously while I was building a server in C for my uni project. The project was such a success I was asked to hold a lecture and talk about it
Thanks for the video really helped me understand how to use select. I think you made a small error though: select(max_socket_so_far, ...); -> select(max_socket_so_far +1, ...); (If you have set two file descriptors "4" and "17", nfds should not be "2", but rather "17 + 1" or "18".) ~man 2 select
I'd like to see the future videos you mentioned making in this one.
Love this tutorial, Would be nice to get an update on this video, you did day you would do improvements in future videos :D
Would love to see the continuation of this. Perhaps using epoll??
Any chance on more networking videos? I really like seeing these type of videos. Not discussed as often as other C/C++ topics.
Your videos are really good!! 👍 when can I see the improvements on this server( I mean event driven programming and asynchronous I/O ? 🙂)
Jacob has the face of a happy little boy
Hey, Sieber, Could you please create video about "static" in C, importance, usage... That is very helpful for beginners.
@thisismeanas