首页 开发技术 C++     /    TCP一对多通信_基于MFC多线程

TCP一对多通信_基于MFC多线程

上传者: wuxia2118 | 上传时间:2017/10/2 22:18:14 | 文件大小:59KB | 文件类型:rar
TCP一对多通信_基于MFC多线程
我用MFCVC6编写的一个TCP一对多通信的程序,就是服务器端利用多线程技术(不使用Select等任何模型),能同时接收多个客户端的消息,其次,服务器端还能将消息群发给所有已连接的客户端,实现的基本思路是将每个线程中accept函数前往的套接字都保存到一个套接字数组中,套接字地址也保存到一个数组中。
然后在“群发”的按钮消息中,用for循环遍历套接字数组,循环执行send函数将消息发送给套接字数组中所有的套接字。
该程序简单完整,非常适合初学者研究WinSock一对多通信

文件下载

资源详情

[{"title":"(37个子文件59KB)TCP一对多通信_基于MFC多线程","children":[{"title":"Chat客户端","children":[{"title":"TCPzcli.clw <span style='color:#111;'>1.31KB</span>","children":null,"spread":false},{"title":"TCPzcli.dsp <span style='color:#111;'>4.08KB</span>","children":null,"spread":false},{"title":"TCPzcli.rc <span style='color:#111;'>5.52KB</span>","children":null,"spread":false},{"title":"res","children":[{"title":"TCPzcli.ico <span style='color:#111;'>1.05KB</span>","children":null,"spread":false},{"title":"TCPzcli.rc2 <span style='color:#111;'>399B</span>","children":null,"spread":false}],"spread":true},{"title":"TCPzcli.aps <span style='color:#111;'>20.45KB</span>","children":null,"spread":false},{"title":"TCPzcli.plg <span style='color:#111;'>1.56KB</span>","children":null,"spread":false},{"title":"TCPzcliDlg.cpp <span style='color:#111;'>6.30KB</span>","children":null,"spread":false},{"title":"StdAfx.cpp <span style='color:#111;'>209B</span>","children":null,"spread":false},{"title":"resource.h <span style='color:#111;'>915B</span>","children":null,"spread":false},{"title":"TCPzcliDlg.h <span style='color:#111;'>1.63KB</span>","children":null,"spread":false},{"title":"TCPzcli.cpp <span style='color:#111;'>2.03KB</span>","children":null,"spread":false},{"title":"StdAfx.h <span style='color:#111;'>1.03KB</span>","children":null,"spread":false},{"title":"TCPzcli.dsw <span style='color:#111;'>520B</span>","children":null,"spread":false},{"title":"TCPzcli.opt <span style='color:#111;'>52.50KB</span>","children":null,"spread":false},{"title":"TCPzcli.h <span style='color:#111;'>1.30KB</span>","children":null,"spread":false},{"title":"ReadMe.txt <span style='color:#111;'>3.51KB</span>","children":null,"spread":false},{"title":"TCPzcli.ncb <span style='color:#111;'>65.00KB</span>","children":null,"spread":false}],"spread":false},{"title":"Chat服务器端","children":[{"title":"Chat.plg <span style='color:#111;'>907B</span>","children":null,"spread":false},{"title":"Chat.aps <span style='color:#111;'>34.28KB</span>","children":null,"spread":false},{"title":"res","children":[{"title":"Chat.ico <span style='color:#111;'>1.05KB</span>","children":null,"spread":false},{"title":"Chat.rc2 <span style='color:#111;'>396B</span>","children":null,"spread":false}],"spread":true},{"title":"Chat.clw <span style='color:#111;'>961B</span>","children":null,"spread":false},{"title":"chatdlg2.cpp <span style='color:#111;'>5.40KB</span>","children":null,"spread":false},{"title":"Chat.dsw <span style='color:#111;'>514B</span>","children":null,"spread":false},{"title":"ChatDlg.h <span style='color:#111;'>1.75KB</span>","children":null,"spread":false},{"title":"Chat.cpp <span style='color:#111;'>2.08KB</span>","children":null,"spread":false},{"title":"Chat.opt <span style='color:#111;'>53.50KB</span>","children":null,"spread":false},{"title":"StdAfx.cpp <span style='color:#111;'>206B</span>","children":null,"spread":false},{"title":"resource.h <span style='color:#111;'>819B</span>","children":null,"spread":false},{"title":"StdAfx.h <span style='color:#111;'>1.08KB</span>","children":null,"spread":false},{"title":"Chat.h <span style='color:#111;'>1.27KB</span>","children":null,"spread":false},{"title":"ChatDlg.cpp <span style='color:#111;'>6.54KB</span>","children":null,"spread":false},{"title":"Chat.dsp <span style='color:#111;'>4.03KB</span>","children":null,"spread":false},{"title":"Chat.ncb <span style='color:#111;'>57.00KB</span>","children":null,"spread":false},{"title":"ReadMe.txt <span style='color:#111;'>3.46KB</span>","children":null,"spread":false},{"title":"Chat.rc <span style='color:#111;'>4.96KB</span>","children":null,"spread":false}],"spread":false}],"spread":true}]

评论信息

免责申明

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