Get the latest tech news

Implementing a Single-Threaded Blocking Bare Bones TCP/IP Server


This newsletter post is a continuation of my previous introductory post on coding distributed systems from the bare bones. If you haven't read it yet, I recommend giving it a read. In this post, I'll be discussing the implementation of a basic TCP/IP server that will, down the road, enable us to implement a node cluster for implementing replicated state machines (You'll find the background info on this in the previous post). With that being said, let's get started.

However, when dealing with text-based communication over the network, such as sending and receiving strings or textual data, it's often more convenient and efficient to work with characters rather than raw bytes. CodeCrafters is a platform that helps us code distributed systems like Redis, Docker, Git, a DNS server, and more step-by-step from the bare bones in the programming language of our choice. If you wish to master the fundamentals, check out my Zero to Software Architecture Proficiency learning path, comprising three courses that go through all the concepts starting from zero in an easy-to-understand language.

Get the Android app

Or read this on Hacker News

Read more on:

Photo of TCP

TCP

Photo of bare bones

bare bones

Photo of threaded blocking

threaded blocking

Related news:

News photo

Starlink offers 'unusually hostile environment' to TCP