singularity

Chapter 20: Final Project: Building a Multithreaded Web Server

Building a Single-Threaded Web Server

Listening to the TCP Connection

Reading the Request

A Closer Look at an HTTP Request

Writing a Response

Returning Real HTML

Validating the Request and Selectively Responding

A Touch of Refactoring

Turning Our Single-Threaded Server into a Multithreaded Server

Simulating a Slow Request

Improving Throughput with a Thread Pool

Graceful Shutdown and Cleanup

Implementing the Drop Trait on ThreadPool

Signaling to the Threads to Stop Listening for Jobs