explaingit

yuesong-feng/30daymakecppserver

7,028C++Audience · developerComplexity · 3/5Setup · moderate

TLDR

A 30-day hands-on tutorial in Chinese for building a high-performance network server in C++ on Linux, going from raw sockets to a multi-threaded Reactor pattern step by step.

Mindmap

mindmap
  root((30dayCppServer))
    What it does
      Teach server internals
      Day by day progression
      Working code each day
    Core Concepts
      TCP sockets
      epoll I/O
      Reactor pattern
      Thread pool
    Tech Stack
      C++
      Linux
      Make
    Audience
      C++ learners
      Systems programmers
    Progress
      16 days published
      Community continuation
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Things people build with this

USE CASE 1

Learn how Linux epoll works by building a real event-driven TCP server from scratch across 16 published days.

USE CASE 2

Use the completed code as a reference implementation of the Reactor pattern in modern C++.

USE CASE 3

Follow the day-by-day progression to understand why high-performance servers use non-blocking I/O instead of one thread per connection.

Tech stack

C++LinuxepollMake

Getting it running

Difficulty · moderate Time to first run · 30min

Requires Linux with g++ and make, each day builds independently with a single make command inside the day folder.

In plain English

This is a 30-day self-paced tutorial for building a network server in C++ on Linux, written in Chinese. Each day covers a focused topic and produces working code that you can compile and run, so you can see your progress at the end of every session rather than waiting until the end of the course. The tutorial is aimed at people who already know C or C++ basics and want to understand how high-performance server software actually works at the system level. The author's argument is that using higher-level languages or frameworks can teach you to build servers, but not why they perform the way they do. Understanding low-level concepts like TCP connections, sockets, memory buffers, and Linux-specific I/O mechanisms requires working in C or C++. The 16 published days cover building a basic socket server, proper error handling, using epoll (a Linux mechanism for monitoring many network connections efficiently), organizing the code into classes, adding an event-driven core, accepting connections, managing TCP connections as objects, adding read and write buffers, integrating a thread pool for handling work in parallel, restructuring the server into a multi-threaded Reactor pattern, and refactoring to use smart pointers. Each day links to a tutorial document in the repository, and the source code for each day is organized into folders. Running make inside a day's folder produces a server binary and a client binary, so you can test the interaction between the two. The tutorial is unfinished, and the author has noted that a separate project by another contributor continues where this one left off.

Copy-paste prompts

Prompt 1
Explain how the epoll-based event loop in the 30daymakecppserver project handles multiple TCP connections simultaneously without blocking.
Prompt 2
Walk me through Day 8 of this C++ server tutorial: how read and write buffers are structured and why they are needed.
Prompt 3
Show me how to add a simple HTTP request parser to the Day 16 Reactor server so it responds to GET requests.
Prompt 4
How does the thread pool in this C++ server distribute incoming connection work, and how would I change the pool size?
Open on GitHub → Explain another repo

← yuesong-feng on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.