Giter Club home page Giter Club logo

singhttpserver's Introduction

SingHttpServer

概述

为学习C++网络编程所编写的,基于Reactor模式开发的Web服务器,可以解析GET请求,处理静态资源。

整体架构

采取单Reactor模式,一个主线程多个工作线程,主线程负责监听和接受链接,工作线程负责处理请求和读写任务。当fd有可读/写事件时,主线程将可调用对象放入工作队列,工作线程通过竞争条件获取任务执行。(参照半同步半反应堆模式)

features:

  • 使用 线程池 + epoll水平触发 +Reactor事件处理模式的并发模型
  • 使用状态机解析HTTP请求,支持解析GET请求
  • 支持HTTP长连接,使用最小堆管理的定时器处理超时链接
  • 经Webbench压力测试验证可以实现上万的并发链接的数据交换

singhttpserver's People

Contributors

misakiofscut avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.