GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - wendysuly/DServerFramework: Distributed Server Framework, such for Game. Using C++

BranchesTags
Open more actions menu

Latest commit

 

History

22 Commits
22 Commits

Folders and files

NameName
Last commit message
Last commit date
DDServerFramework
DDServerFramework
 
 
服务器架构文档
服务器架构文档
 
 
.gitmodules
.gitmodules
 
 
README.md
README.md
 
 

Repository files navigation

##分布式服务器框架

##框架简介

  • 此框架由三种服务器组成:

    • n个连接服务器:负责处理客户端的网络链接,并转发客户端和逻辑服务器之间的消息。
    • n个逻辑服务器:负责处理(由链接服务器转发过来的)客户端的网络消息
    • 1个全局服务器:负责处理全局逻辑
    • 其实还额外需要一个神器:etcd,作为服务器框架中的逻辑服务器感知链接服务器的新增和失效
    • 无论拓扑图请参考架构图: Alt text
  • 框架内置组件:

    • 多连接ssdb客户端
    • redis/ssdb代理服务器
    • 仅支持C++语言的RPC(支持protobuf类型消息,适合服务器之间业务开发,并支持异步回调)

##既定规则(建议)

  • 客户端拥有最多两个逻辑服务器:分别是Primay和Slave
  • 当客户端链接某链接服务器会(自动)分配一个Primary类型的逻辑服务器(且不会、也不能重设)
  • 客户端的消息优先(转到到)Slave处理
  • 逻辑服务器可自由设置客户端的当前Slave
  • 当然,客户端的Primay和Slave可以为同一个逻辑服务器
  • 实际项目中,您可以借助第三方负载均衡服务器来分配链接服务器的地址给客户端.
  • 内置有ssdb客户端和ssdb代理服务器,如果你的应用需要数据库,不妨一试。

##使用方式

  • 开发应用时,只需要关注客户端和逻辑服务器之间的消息设定,不需要考虑链接服务器,且没有任何(需要引入的)预设消息。
  • 开发应用时,只需要分别实现逻辑服务器中的initLogicServerExt函数 和 (可选)全局服务器中的initCenterServerExt函数 (通常进行消息handle注册即可)。
  • 作为示例
    • 中心服务器的扩展参考CenterServerExt.cpp
    • 逻辑服务器的扩展参考LogicServerExt.cpp
    • 测试客户端请看:SimulateClient.cpp

About

Distributed Server Framework, such for Game. Using C++

Resources

Readme
Activity

Stars

0 stars

Watchers

1 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.