In the last few days, I recreated a TCP server from scratch multiple times (6 times to be precise).
I intentionally started with the simplest version possible, without any Goroutines or any abstractions, just a basic server and client model, because I wanted to understand exactly what was happening at each step and why and also the other thing was to train my muscle memory by repeatedly implementing the same concepts instead of just reading about them.
I got stuck multiple times on blocking behavior and even managed to create race conditions like situations even with a single client.
After enough iterations, I finally got a basic version working without goroutines and without relying on AI just docs and one video.
Then I added a single goroutine and was surprised to see the server handle multiple clients concurrently without blocking(3 clients at a time)
Whatever the assumptions I had about concurrency became obvious after rebuilding the same thing over and over again.
Next, I want to understand what happens when the number of clients grows significantly and explore concepts like worker pools, queues, and efficient goroutine management.