Windows下基于socket多线程并发通信的实现

上传者: xy010902100449 | 上传时间: 2019-12-21 22:07:16 | 文件大小: 12.1MB | 文件类型: rar
本文介绍了在Windows 操作系统下基于TCP/IP 协议Socket 套接口的通信机制以及多线程编程知识与技巧,并给出多线程方式实现多用户与服务端(C/S)并发通信模型的详细算法,最后展现了用C++编写的多用户与服务器通信的应用实例并附有程序。 关键词:Windows;套接字;多线程;并发服务器; Socket 是建立在传输层协议(主要是TCP 和UDP)上的一种套接字规范,最初由美国加州Berkley 大学提出,为UNIX 系统开发的网络通信接口,它定义了两台计算机之间通信的规范,socket 屏蔽了底层通信软件和具体操作系统的差异,使得任何两台安装了TCP 协议软件和实现了Socket 规范的计算机之间的通信成为可能,Socket 接口是TCP/IP 网络最为通用的应用接口,也是在Internet 上进行网络程序应用开发最通用的API[1],本文介绍了Socket通信的基本机制以及采用多线程技术实现并发通信的基本原理,并给出实例。

文件下载

资源详情

[{"title":"( 58 个子文件 12.1MB ) Windows下基于socket多线程并发通信的实现","children":[{"title":"Socket(TCP)","children":[{"title":"SocketSeverThread","children":[{"title":"SocketSever","children":[{"title":"stdafx.cpp <span style='color:#111;'> 216B </span>","children":null,"spread":false},{"title":"SocketSever.vcproj.USER-20140331IT.Administrator.user <span style='color:#111;'> 1.39KB </span>","children":null,"spread":false},{"title":"stdafx.h <span style='color:#111;'> 233B </span>","children":null,"spread":false},{"title":"Socket.cpp <span style='color:#111;'> 788B </span>","children":null,"spread":false},{"title":"targetver.h <span style='color:#111;'> 498B </span>","children":null,"spread":false},{"title":"SocketSever.cpp <span style='color:#111;'> 3.53KB </span>","children":null,"spread":false},{"title":"SocketSever.vcproj <span style='color:#111;'> 4.52KB </span>","children":null,"spread":false},{"title":"Socket.h <span style='color:#111;'> 988B </span>","children":null,"spread":false},{"title":"Debug","children":[{"title":"SocketSever.obj <span style='color:#111;'> 30.27KB </span>","children":null,"spread":false},{"title":"SocketSever.pch <span style='color:#111;'> 3.06MB </span>","children":null,"spread":false},{"title":"stdafx.obj <span style='color:#111;'> 12.30KB </span>","children":null,"spread":false},{"title":"BuildLog.htm <span style='color:#111;'> 7.56KB </span>","children":null,"spread":false},{"title":"SocketSever.exe.embed.manifest <span style='color:#111;'> 663B </span>","children":null,"spread":false},{"title":"SocketSever.exe.embed.manifest.res <span style='color:#111;'> 728B </span>","children":null,"spread":false},{"title":"vc90.pdb <span style='color:#111;'> 172.00KB </span>","children":null,"spread":false},{"title":"vc90.idb <span style='color:#111;'> 467.00KB </span>","children":null,"spread":false},{"title":"mt.dep <span style='color:#111;'> 65B </span>","children":null,"spread":false},{"title":"SocketSever.exe.intermediate.manifest <span style='color:#111;'> 621B </span>","children":null,"spread":false},{"title":"Socket.obj <span style='color:#111;'> 24.45KB </span>","children":null,"spread":false}],"spread":false},{"title":"ReadMe.txt <span style='color:#111;'> 1.18KB </span>","children":null,"spread":false}],"spread":true},{"title":"SocketSever.suo <span style='color:#111;'> 10.50KB </span>","children":null,"spread":false},{"title":"SocketSeverThread.sln <span style='color:#111;'> 899B </span>","children":null,"spread":false},{"title":"SocketSever.ncb <span style='color:#111;'> 11.35MB </span>","children":null,"spread":false},{"title":"SocketSeverThread.suo <span style='color:#111;'> 12.00KB </span>","children":null,"spread":false},{"title":"Debug","children":[{"title":"SocketSever.exe <span style='color:#111;'> 32.00KB </span>","children":null,"spread":false},{"title":"SocketSever.pdb <span style='color:#111;'> 563.00KB </span>","children":null,"spread":false},{"title":"SocketSever.ilk <span style='color:#111;'> 370.52KB </span>","children":null,"spread":false}],"spread":true},{"title":"SocketSeverThread.ncb <span style='color:#111;'> 10.82MB </span>","children":null,"spread":false}],"spread":true},{"title":"SocketClientThread","children":[{"title":"SocketClientThread","children":[{"title":"SocketClient.suo <span style='color:#111;'> 10.50KB </span>","children":null,"spread":false},{"title":"Release","children":null,"spread":false},{"title":"SocketClientThread.sln <span style='color:#111;'> 902B </span>","children":null,"spread":false},{"title":"SocketClient.ncb <span style='color:#111;'> 10.80MB </span>","children":null,"spread":false},{"title":"SocketClientThread.ncb <span style='color:#111;'> 10.82MB </span>","children":null,"spread":false},{"title":"SocketClientThread.suo <span style='color:#111;'> 10.00KB </span>","children":null,"spread":false},{"title":"SocketClient","children":[{"title":"stdafx.cpp <span style='color:#111;'> 217B </span>","children":null,"spread":false},{"title":"Release","children":null,"spread":false},{"title":"stdafx.h <span style='color:#111;'> 233B </span>","children":null,"spread":false},{"title":"SocketClient.vcproj.USER-20140331IT.Administrator.user <span style='color:#111;'> 1.39KB </span>","children":null,"spread":false},{"title":"Socket.cpp <span style='color:#111;'> 786B </span>","children":null,"spread":false},{"title":"targetver.h <span style='color:#111;'> 498B </span>","children":null,"spread":false},{"title":"SocketSever.cpp <span style='color:#111;'> 1.98KB </span>","children":null,"spread":false},{"title":"SocketClient.cpp <span style='color:#111;'> 2.91KB </span>","children":null,"spread":false},{"title":"Socket.h <span style='color:#111;'> 988B </span>","children":null,"spread":false},{"title":"SocketClient.vcproj.USER-20141117OX.Administrator.user <span style='color:#111;'> 1.39KB </span>","children":null,"spread":false},{"title":"Debug","children":[{"title":"SocketClient.pch <span style='color:#111;'> 3.06MB </span>","children":null,"spread":false},{"title":"SocketClient.obj <span style='color:#111;'> 29.78KB </span>","children":null,"spread":false},{"title":"stdafx.obj <span style='color:#111;'> 12.52KB </span>","children":null,"spread":false},{"title":"BuildLog.htm <span style='color:#111;'> 8.41KB </span>","children":null,"spread":false},{"title":"SocketClient.exe.embed.manifest <span style='color:#111;'> 663B </span>","children":null,"spread":false},{"title":"vc90.pdb <span style='color:#111;'> 172.00KB </span>","children":null,"spread":false},{"title":"vc90.idb <span style='color:#111;'> 475.00KB </span>","children":null,"spread":false},{"title":"mt.dep <span style='color:#111;'> 65B </span>","children":null,"spread":false},{"title":"SocketClient.exe.intermediate.manifest <span style='color:#111;'> 621B </span>","children":null,"spread":false},{"title":"SocketClient.exe.embed.manifest.res <span style='color:#111;'> 728B </span>","children":null,"spread":false},{"title":"Socket.obj <span style='color:#111;'> 24.68KB </span>","children":null,"spread":false}],"spread":false},{"title":"SocketClient.vcproj <span style='color:#111;'> 4.53KB </span>","children":null,"spread":false},{"title":"ReadMe.txt <span style='color:#111;'> 1.18KB </span>","children":null,"spread":false}],"spread":false},{"title":"Debug","children":[{"title":"SocketClient.exe <span style='color:#111;'> 31.50KB </span>","children":null,"spread":false},{"title":"SocketClient.pdb <span style='color:#111;'> 555.00KB </span>","children":null,"spread":false},{"title":"SocketClient.ilk <span style='color:#111;'> 356.71KB </span>","children":null,"spread":false}],"spread":true}],"spread":true}],"spread":true}],"spread":true}],"spread":true}]

评论信息

  • best_LY :
    客户端打开之后 什么都没有?是要怎么输入?建议写个readme.txt
    2020-10-12
  • 鄜州与月 :
    客户端打开之后 什么都没有?是要怎么输入?建议写个readme.txt
    2020-10-12
  • wang1051477875 :
    mark,学习分享,分享学习
    2018-08-22
  • windyProX :
    mark,学习分享,分享学习
    2018-08-22
  • lisongjia123 :
    一个不错的资源,感谢露珠
    2018-06-25
  • 拂晓Skyler :
    一个不错的资源,感谢露珠
    2018-06-25
  • changchang700 :
    还不错的啊
    2018-06-22
  • changchang700 :
    还不错的啊
    2018-06-22
  • qq_15724883 :
    学习一下, 感谢楼主
    2018-06-14
  • Dark-Source :
    学习一下, 感谢楼主
    2018-06-14

免责申明

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