Show HN: I built a concurrent BitTorrent engine in Go to master P2P protocols https://ift.tt/FuCy6IR
Show HN: I built a concurrent BitTorrent engine in Go to master P2P protocols I’ve always used BitTorrent, but I never understood the complexity of peer-to-peer orchestration until I tried to build it from scratch. I wanted to move beyond simple "Hello World" projects and tackle something that involved real-world constraints: network latency, data poisoning, and the "Slow Peer Problem." Key Technical Challenges I Solved: Non-Blocking Concurrency: Used a worker pool where each peer gets its own Goroutine. I implemented a "Stateless Worker" logic where if a peer fails a SHA-1 hash check or drops the connection, the piece is automatically re-queued into a thread-safe channel for other peers to pick up. Request Pipelining: To fight network RTT, I implemented a pipeline depth of 5. The client dispatches multiple 16KB block requests without waiting for the previous one to return, ensuring the bandwidth is fully saturated. The Binary Boundary: Dealing with Big-En...