web game server architecture
来源:互联网 发布:记事本编写php 编辑:程序博客网 时间:2024/05/24 01:47
黑色的线代表socket长连接,橙色的线代表socket短连接,蓝色的线代表数据处理流程
1客户端发送数据包到boost ASIO server,
2server先将包发送到preprocess模块处理;这个模块是和游戏逻辑关联的,比如模型协议的包可以直接丢弃,某些协议的包可以跳过php部分的处理等等;由于处理逻辑和游戏逻辑关联,所以采用动态链接库方式,以便逻辑更改之后服务器不用重启;
3大多数的数据包需要发送到php端处理,使用fastcgi协议发送到php-fpm,然后接收回包;此处是短连接,每次发送之前都建立连接,收到回包后断开连接;
4将php处理之后的包发送到postprocess模块处理;这个模块也是和游戏逻辑关联的,也是使用动态链接库方式;
5将数据包发送回到客户端;
其中黄色的方块代表一个session,一个session里面包含两个socket,一个是和客户端通讯的,一个是和php-fpm通讯的;
如果server到php端可以使用长连接的话,session里面的和php通讯的socket就可以去掉,改为一个线程一个socket,可以节省近一半的socket,不过尝试了很多次长连接都失败,于是放弃;
- web game server architecture
- new web game server
- WEB ARCHITECTURE
- Project Darkstar Game Architecture
- game engine architecture---1.6
- Game Engine Architecture 封面
- Web Application Architecture-WebSphere Application Server应用实践
- Dedicated Server Architecture&Shared Server Architecture
- game engine architecture----1.1--1.5
- Game Engine Architecture: URL List
- Linux Mobile Game Sever(Architecture)
- High-Performance Server Architecture
- high-performance server architecture
- BigWorld Server - Architecture
- Client/Server architecture
- High-Performance Server Architecture
- High-Performance Server Architecture
- High-Performance server architecture
- poj 1321 -- 棋盘问题 (DFS)
- 输出所有的最长公共子序列
- webdriver实现窗口切换
- 杭电2013蟠桃园(水题)
- Raspberry Pi with Node.js and Arduino
- web game server architecture
- jQuery实例集合
- c#仿QQ顶置自动隐藏的效果
- linux0.11 minix1.0文件系统 下篇 根节点的 buffer_head结构,根节点内容
- EJB3.0学习笔记---理解远程调用服务端和本地调用服务端的区别
- 关于隐藏转换的代码
- 临窗静坐
- WiringPi Pins-From Gordon
- Java Socket 3