文件名称:server1
介绍说明--下载内容来自于网络,使用问题请自行百度
1V1实现了,1V多也就容易了。不过相对于1V1的程序,我经过大改,采用链表来动态管理。这样效率真的提升不少,至少CPU使用率稳稳的在20以下,不会飙到100了。用C语言写这个还是挺费时间的,因为什么功能函数都要自己写,不像C++有STL库可以用,MFC写就更简单了,接下来我还会更新MFC版本的多人聊天程序。好了,废话少说,进入主题。
这个程序要解决的问题如下:
1.CPU使用率飙升问题 –>用链表动态管理
2.用户自定义聊天,就是想跟谁聊跟谁聊 –> _Client结构体中新增一个ChatName字段,用来表示要和谁聊天,这个字段很重要,因为server转发消息的时候就是按照这个字段来转发的。(1V1 is implemented, and 1V is easy. However, relative to the 1V1 program, I have undergone a big change, using the chain list to dynamically manage. This efficiency has really improved a lot, at least the CPU use rate is stable below 20, and will not go to 100. It will take a lot of time to write this in C language, because what function functions should be written by oneself, unlike C++, which can be used by STL library, and MFC writing is simpler. Next, I will update MFC version of multi person chat program. Well, talk less and get into the subject.
The problems to be solved in this program are as follows:
1.CPU usage surge problem - > dynamic management with chain list
2., user defined chat is just to chat with anyone. - > add a ChatName field to _Client structure to show who to chat with. This field is very important, because server forwarding the message is based on this field.)
这个程序要解决的问题如下:
1.CPU使用率飙升问题 –>用链表动态管理
2.用户自定义聊天,就是想跟谁聊跟谁聊 –> _Client结构体中新增一个ChatName字段,用来表示要和谁聊天,这个字段很重要,因为server转发消息的时候就是按照这个字段来转发的。(1V1 is implemented, and 1V is easy. However, relative to the 1V1 program, I have undergone a big change, using the chain list to dynamically manage. This efficiency has really improved a lot, at least the CPU use rate is stable below 20, and will not go to 100. It will take a lot of time to write this in C language, because what function functions should be written by oneself, unlike C++, which can be used by STL library, and MFC writing is simpler. Next, I will update MFC version of multi person chat program. Well, talk less and get into the subject.
The problems to be solved in this program are as follows:
1.CPU usage surge problem - > dynamic management with chain list
2., user defined chat is just to chat with anyone. - > add a ChatName field to _Client structure to show who to chat with. This field is very important, because server forwarding the message is based on this field.)
相关搜索: socket编程
(系统自动生成,下载前可以参看下载内容)
下载文件列表
本网站为编程资源及源代码搜集、介绍的搜索网站,版权归原作者所有! 粤ICP备11031372号
1999-2046 搜珍网 All Rights Reserved.