Learning Linux, C/C++ and background development needs to pay attention to actual combat, can practice according to this project start.

The code base is based on the code in the book of the game, some things have been modified, his code can not send large files, writev also has some problems (I don’t know if the fix has been released).

Current functions, access to files, pictures. Well written HTML pages are also accessible. You can use it to practice your hands.

Techniques used: epoll, base sockets, threads, thread pools, HTTP parsing.

The code is simply attached, without much explanation. I also have a wide range of knowledge, and some parts are not explained, so beginners may be confused, so I will explain the whole project in succession.

It can be roughly divided into the following parts: basic socket use, pThread thread and thread pool use, epoll multiplexing, REACTOR and HTTP theoretical knowledge, C/C++ analysis process, THE use of VScode remote tools and problem analysis.

Open source the code on Github.

Github.com/hqingLau/ti…

The following is a README:

Tiny web server for study usage. Put files in /var/www/html.You can learn threadpool, epoll, http parsing… from here.

Example:

visit a.html in browser.

Ref Code: Linux High Performance Server Programming

Fixed some problems, such as big file transfering, writev error.