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 <配置文件> <加载模块路径>