Why most TCP servers are multi threaded and how to build one from scratch

preview_player
Показать описание

Build Your Own Redis / DNS / BitTorrent / SQLite - with CodeCrafters.

In this video, I explained how to build a TCP server from scratch using raw sockets in a programming language like Go. I covered the basics of socket programming, system calls, handling multiple TCP connections, and processing HTTP requests. We created a simple server that listens to a port, accepts connections, reads requests, processes them, sends responses, and closes connections. However, the server we built could only handle one request at a time due to its single-threaded nature.

# Recommended videos and playlists

If you liked this video, you will find the following videos and playlists helpful

# Things you will find amusing

# Other socials

I keep writing and sharing my practical experience and learnings every day, so if you resonate then follow along. I keep it no fluff.

Thank you for watching and supporting! it means a ton.

I am on a mission to bring out the best engineering stories from around the world and make you all fall in
love with engineering. If you resonate with this then follow along, I always keep it no-fluff.
Рекомендации по теме
Комментарии
Автор

Hey Arpit, I've been following your channel for a while now and I've seen all your videos on system design and related concepts - I'm a huge fan! This video on building a TCP server is just amazing, and I love how it shows the practical side of things. It's so helpful to see real-world examples like this. I'd be thrilled if you could continue creating more content in this style. Keep up the fantastic work, and thanks for sharing your expertise with all of us! 🙌👩‍💻🚀

uditsankhadasariya
Автор

One of the best 28 minutes invested. Thanks Arpit!

mitulvaghela
Автор

Damn, how can someone demystify the concept of "writing your own", which sounds quite scary, so beautifully. While watching this video i was glued to my computer screen. Thanks Arpit

Samagarwalsam
Автор

I always had this curiosity in the head that how multiple connections are handled in prod but kept procrastinating untill today i watched this and went into dissecting them.

krsingh.shubham
Автор

I have never really thought, infinite for loop or loop is a valid usecase without knowing that every single day I am using it in interacting with each and every web server. Wonderful video... felt like my weekend was productive by watching this video, Thanks.

MegaSurya
Автор

There are very less useful videos on GoLang. I have started following you one month back and I can see how engineer should have thinking process. Also I am DevOps engineer and started learing golang just for my interest. Thank you for this video. Keep it up.

vikrantverma
Автор

this channel is a goldmine, how come i did not find it earlier.
new saw anyone explaining TCP like this. Buonissimo!

lakshayasood
Автор

This thing had intrigued me around 6 years back and I went ahead and implemented both single and multi threaded TCP sockets in Java :D

debashisdeb
Автор

What an amazing teacher you're, never enjoyed learning more. Extraordinarily simplified.

nihshrey
Автор

It would be great if there is a follow up video on this improving the servers with thread pools and with tcp backlog queue configuration.

sadammohamed-rp
Автор

Best 28 Minutes spent on YouTube learning something! Thank you for such valuable content 🎉

YashKhareDev
Автор

amazing video, please make these types of videos with practical implementation 🎉

ujjawal_
Автор

awesome video!! I was expecting you to talk about I/O multiplexing as well when you were talking about multi-threaded servers, and indeed you did in the 24th minute!!

TheNayanava
Автор

Really good video. Well explained and simple to understand.

moxy-bison
Автор

Great video, everyone should watch and should be aware of how multi threaded TCP web servers work

AleksandarT
Автор

Arpit, Its a great and informative video. Really appreciate your efforts. It would have been good if you have included what is socket in tcp connection.

kumarssk
Автор

Hey, Arpit . Amazing Explanation and description 🔥.

dishantvashistha
Автор

Thanks arpit this video is amazing. I kind of had an idea that spring or any framework does this but this video increased my clarity.

devashishrai
Автор

Loved the explanation ❤.
So simple amazing, Thanks

imamansoni
Автор

Love your content. May you never stop these quality videos.

jayjay