Skip to content

hijkzzz/web-server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

46 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

speed-x

A HTTP server designed with Reactor I/O Model

Design Pattern

One Loop Per Thread

  • Each thread has an event loop epoll

Multiple Reactor

  • Main event loop is responsible for listenfd and accept
  • Sub event loop is responsible for handleEvent
  • Use the roundbin scheduling policy

Flow Diagram

Establish Connection

The main reactor(event loop) distributes the connection to the sub-reactor, when a new connection is made

Close Connection

Requirements

  • Linux
  • GCC
  • Boost

Build

sudo apt-get install libboost-all-dev
cd build
cmake ..
make

Usage

./speedX

http://127.0.0.1:8000

References

  • Linux多线程服务端编程

About

A Web Server designed with Reactor I/O Model

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published