Giter Site home page Giter Site logo

async_server's Introduction

ASYNC_SERVER

一个服务端程序, 将多个client的连接, 转为一个连接, 交由后端处理.
支持设置超时时间, 后端处理超时, 自动关闭client连接.
支持多种协议(HTTP, ISO8583), 支持监听多个端口

2022/02/10更新

  1. 优化部分流程 2. 完善HTTP错误信息返回 3. 添加log cache和写log的操作

2022/07/18更新

  1. 简化代码

项目文件目录

.
├── include
│   ├── async_server.h
│   ├── http_parser.h       # http解析
│   ├── queue.h             # nginx的队列, 有所修改
│   └── rbtree.h            # nginx的红黑树, 有所修改
├── Makefile
├── README.md
└── src
    ├── async_server.c      # async_server的代码
    ├── echo.c              # 反射程序, 配合server使用, 固定响应
    ├── http_parser.c       # http解析
    ├── rbtree.c            # nginx的红黑树, 有所修改
    └── server.c            # server程序

依赖包


2022/05/11

最近在研究协程,是时候重构啦。除此之外,还想解决当前版本的一些不足

  1. 数据读取的buf是存在内存的,通过realloc扩容,但是不可能做到很大。是否可以先缓存到硬盘?
  2. 使用协程的话,很多接口都需要重写,包括队列的操作
  3. 在key查询的时候,能否用hash map代替rbtree

async_server's People

Contributors

liuyuguang 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.