A HTTP server designed with Reactor I/O Model
One Loop Per Thread
- Each thread has an event loop
epoll
Multiple Reactor
- Main event loop is responsible for
listenfd
andaccept
- Sub event loop is responsible for
handleEvent
- Use the roundbin scheduling policy
Establish Connection
The main reactor(event loop) distributes the connection to the sub-reactor, when a new connection is made
Close Connection
- Linux
- GCC
- Boost
sudo apt-get install libboost-all-dev
cd build
cmake ..
make
./speedX
http://127.0.0.1:8000
- Linux多线程服务端编程