首页 开发技术 C++     /    CSDN-TCP基于数据包通讯框架

CSDN-TCP基于数据包通讯框架

上传者: fanxiushu | 上传时间:2023/12/2 4:42:36 | 文件大小:224KB | 文件类型:rar
CSDN-TCP基于数据包通讯框架
这个工程是基于TCP长连接的包模式的网络通讯框架。
在TCP连接中,按照一个一个的包方式进行数据传输,框架实现了可以同时侦听多个端口,每个数据包既可以不压缩传输,也能支持zlib压缩和blowfish加密传输。
服务端提供三种线程池来进行tcp连接处理,一类是接收线程池,接收线程池获取每个socket传输来的数据包,同时保证每个socket的包按照到来的顺序进行处理,二类是工作线程池,由接收线程池把接收到的数据包投递到工作线程池,工作线程池专门处理这些接收到的数据包。
三类是发送线程池,当工作线程池处理完这些数据包,确定需要发送处理结果数据包到客户端,或者其他线程需要发送数据包到客户端,他们首先把数据包投递到发送线程池,发送线程池专门负责数据包的发送。
框架同时提供了每个客户端的定时器功能,在服务端内部各个socket之间数据通信等。
框架来源于一个没做完的手游服务端,至于没有使用现成的游戏通讯框架而自己实现,主要是因为习惯了自己造轮子。
因为项目没做完,所有没进行严格的测试,无法保证代码无BUG。
您若要使用到自己的项目中,请完全熟悉了之后再用,这样出现BUG也好自己修改。
框架支持Linux和windows平台。
相关BLOG请看如下连接:http://blog.csdn.net/fanxiushu/article/details/50631626

文件下载

资源详情

[{"title":"(65个子文件224KB)CSDN-TCP基于数据包通讯框架","children":[{"title":"base_server","children":[{"title":"src","children":[{"title":"main.cpp <span style='color:#111;'>2.38KB</span>","children":null,"spread":false},{"title":"server","children":[{"title":"common.cpp <span style='color:#111;'>9.41KB</span>","children":null,"spread":false},{"title":"base_server.cpp <span style='color:#111;'>28.64KB</span>","children":null,"spread":false},{"title":"list_entry.h <span style='color:#111;'>2.32KB</span>","children":null,"spread":false},{"title":"common.h <span style='color:#111;'>7.49KB</span>","children":null,"spread":false},{"title":"list_v1.h <span style='color:#111;'>361B</span>","children":null,"spread":false},{"title":"base_buffer.h <span style='color:#111;'>477B</span>","children":null,"spread":false},{"title":"json.h <span style='color:#111;'>1.54KB</span>","children":null,"spread":false},{"title":"crypt_msg.h <span style='color:#111;'>1.23KB</span>","children":null,"spread":false},{"title":"cJSON.cpp <span style='color:#111;'>27.77KB</span>","children":null,"spread":false},{"title":"log.cpp <span style='color:#111;'>8.27KB</span>","children":null,"spread":false},{"title":"base_server.h <span style='color:#111;'>10.29KB</span>","children":null,"spread":false},{"title":"rwlock.h <span style='color:#111;'>1.64KB</span>","children":null,"spread":false},{"title":"cJSON.h <span style='color:#111;'>7.35KB</span>","children":null,"spread":false},{"title":"crypt_msg.cpp <span style='color:#111;'>6.27KB</span>","children":null,"spread":false},{"title":"base_buffer.cpp <span style='color:#111;'>2.77KB</span>","children":null,"spread":false},{"title":"blowfish.cpp <span style='color:#111;'>17.09KB</span>","children":null,"spread":false},{"title":"list_v1.cpp <span style='color:#111;'>1.23KB</span>","children":null,"spread":false}],"spread":false}],"spread":true},{"title":"base_server.v12.suo <span style='color:#111;'>70.00KB</span>","children":null,"spread":false},{"title":"base_server.suo <span style='color:#111;'>87.00KB</span>","children":null,"spread":false},{"title":"base_server.vcxproj.filters <span style='color:#111;'>4.07KB</span>","children":null,"spread":false},{"title":"makefile <span style='color:#111;'>764B</span>","children":null,"spread":false},{"title":"base_server.sln <span style='color:#111;'>1.29KB</span>","children":null,"spread":false},{"title":"base_server.vcxproj.user <span style='color:#111;'>165B</span>","children":null,"spread":false},{"title":"base_server.vcxproj <span style='color:#111;'>9.37KB</span>","children":null,"spread":false}],"spread":true},{"title":"说明.txt <span style='color:#111;'>1.06KB</span>","children":null,"spread":false},{"title":"zlib_src","children":[{"title":"infback.c <span style='color:#111;'>22.18KB</span>","children":null,"spread":false},{"title":"inflate.h <span style='color:#111;'>6.25KB</span>","children":null,"spread":false},{"title":"crc32.c <span style='color:#111;'>12.87KB</span>","children":null,"spread":false},{"title":"inffast.c <span style='color:#111;'>13.14KB</span>","children":null,"spread":false},{"title":"inffixed.h <span style='color:#111;'>6.18KB</span>","children":null,"spread":false},{"title":"trees.c <span style='color:#111;'>43.22KB</span>","children":null,"spread":false},{"title":"gzlib.c <span style='color:#111;'>16.03KB</span>","children":null,"spread":false},{"title":"uncompr.c <span style='color:#111;'>1.96KB</span>","children":null,"spread":false},{"title":"gzread.c <span style='color:#111;'>18.26KB</span>","children":null,"spread":false},{"title":"deflate.h <span style='color:#111;'>12.47KB</span>","children":null,"spread":false},{"title":"gzwrite.c <span style='color:#111;'>15.82KB</span>","children":null,"spread":false},{"title":"inflate.c <span style='color:#111;'>52.26KB</span>","children":null,"spread":false},{"title":"inftrees.h <span style='color:#111;'>2.86KB</span>","children":null,"spread":false},{"title":"deflate.c <span style='color:#111;'>69.80KB</span>","children":null,"spread":false},{"title":"trees.h <span style='color:#111;'>8.27KB</span>","children":null,"spread":false},{"title":"zlib.h <span style='color:#111;'>85.82KB</span>","children":null,"spread":false},{"title":"crc32.h <span style='color:#111;'>29.85KB</span>","children":null,"spread":false},{"title":"zconf.h <span style='color:#111;'>15.14KB</span>","children":null,"spread":false},{"title":"gzguts.h <span style='color:#111;'>6.40KB</span>","children":null,"spread":false},{"title":"adler32.c <span style='color:#111;'>4.85KB</span>","children":null,"spread":false},{"title":"inftrees.c <span style='color:#111;'>12.72KB</span>","children":null,"spread":false},{"title":"zutil.h <span style='color:#111;'>6.61KB</span>","children":null,"spread":false},{"title":"gzclose.c <span style='color:#111;'>678B</span>","children":null,"spread":false},{"title":"inffast.h <span style='color:#111;'>427B</span>","children":null,"spread":false},{"title":"compress.c <span style='color:#111;'>2.47KB</span>","children":null,"spread":false},{"title":"zutil.c <span style='color:#111;'>7.24KB</span>","children":null,"spread":false}],"spread":false},{"title":"base_client","children":[{"title":"base_client.sln <span style='color:#111;'>967B</span>","children":null,"spread":false},{"title":"src","children":[{"title":"common.cpp <span style='color:#111;'>9.41KB</span>","children":null,"spread":false},{"title":"list_entry.h <span style='color:#111;'>2.32KB</span>","children":null,"spread":false},{"title":"common.h <span style='color:#111;'>7.47KB</span>","children":null,"spread":false},{"title":"client.cpp <span style='color:#111;'>3.73KB</span>","children":null,"spread":false},{"title":"base_buffer.h <span style='color:#111;'>477B</span>","children":null,"spread":false},{"title":"crypt_msg.h <span style='color:#111;'>1.23KB</span>","children":null,"spread":false},{"title":"crypt_msg.cpp <span style='color:#111;'>6.27KB</span>","children":null,"spread":false},{"title":"base_buffer.cpp <span style='color:#111;'>2.70KB</span>","children":null,"spread":false},{"title":"blowfish.cpp <span style='color:#111;'>17.18KB</span>","children":null,"spread":false}],"spread":true},{"title":"base_client.v12.suo <span style='color:#111;'>43.50KB</span>","children":null,"spread":false},{"title":"base_client.vcxproj.filters <span style='color:#111;'>3.26KB</span>","children":null,"spread":false},{"title":"base_client.vcxproj <span style='color:#111;'>5.37KB</span>","children":null,"spread":false}],"spread":true}],"spread":true}]

评论信息

免责申明

【好快吧下载】的资源来自网友分享,仅供学习研究,请务必在下载后24小时内给予删除,不得用于其他任何用途,否则后果自负。基于互联网的特殊性,【好快吧下载】 无法对用户传输的作品、信息、内容的权属或合法性、合规性、真实性、科学性、完整权、有效性等进行实质审查;无论 【好快吧下载】 经营者是否已进行审查,用户均应自行承担因其传输的作品、信息、内容而可能或已经产生的侵权或权属纠纷等法律责任。
本站所有资源不代表本站的观点或立场,基于网友分享,根据中国法律《信息网络传播权保护条例》第二十二条之规定,若资源存在侵权或相关问题请联系本站客服人员,8686821#qq.com,请把#换成@,本站将给予最大的支持与配合,做到及时反馈和处理。关于更多版权及免责申明参见 版权及免责申明