GithubHelp home page GithubHelp logo

kerwinzxc / server-framework Goto Github PK

View Code? Open in Web Editor NEW

This project forked from hujianzhe/server-framework

1.0 0.0 0.0 337 KB

纯C的分布式服务器框架通用模板,跨平台,模块动态加载,tcp/可靠UDP,协程RPC,日志,集群建立

C 93.83% Makefile 4.34% Shell 0.17% C++ 1.66%

server-framework's Introduction

server framework

1、底层库https://github.com/hujianzhe/util, 下载后置于BootServer目录下
2、纯C实现,不依赖任何第三方框架
3、跨平台服务器母机,可具体配置启动参数
4、通过加载动态链接库实现不同的业务逻辑
5、支持异步回调、协程、消息3种RPC调度机制,基于红黑树实现的定时器
6、网络通信支持TCP和可靠UDP,支持自定义消息编解码
7、自带http(支持GET/POST)和websocket协议接入
8、服务发现中心,集群节点建立(可自选不使用本框架的机制)
9、支持按照一致性hash环,hash取余数,依次轮询三种方式选取目标节点
10、本地日志按时间和大小轮替

TODO:
1、一个好的说明文档,实在没时间写
2、丰富报错信息
3、对脚本语言提供支持,目标是可以方便对接脚本写业务逻辑
4、有状态服务节点的扩容与缩容
5、利用本地消息表实现消息幂等

模块介绍:
1、BootServer:进程启动的必备和重复操作,如监听网络事件,逻辑处理线程,读取配置,加载动态链接模块,节点选择路由等通用操作
2、InnerProcHandler:简单集群节点启动后的操作,拉取整体集群整体信息的过程
3、Service:服务节点代码模板,包含了启动之后的必备操作,如拉取整体集群列表等
4、ServiceCenter:用于服务节点注册与修改下发
5、SoTest:测试节点,用于测试功能

编译:
windows直接VS编译,然后把需要的dll拷贝到对应服务目录下
linux下使用make debug 或 make release

启动:
编辑好服务启动需要的配置文件之后
windows直接VS打开,工程配置好启动参数 <配置文件> <加载模块路径>
linux下进入BootServer目录,sh run.sh <配置文件> <加载模块路径>

server-framework's People

Contributors

hujianzhe avatar

Stargazers

 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.