登录
首页 » Windows Socket编程 » 做多客户端与服务器端的双向通信,采用QLocalSocket/QLocalServer实现起来简单,但通信效率太低,客户端发数据,服务器端的readyRead信...

做多客户端与服务器端的双向通信,采用QLocalSocket/QLocalServer实现起来简单,但通信效率太低,客户端发数据,服务器端的readyRead信...

于 2022-05-28 发布 文件大小:17.68 MB
0 73
下载积分: 2 下载次数: 1

代码说明:

做多客户端与服务器端的双向通信,采用QLocalSocket/QLocalServer实现起来简单,但通信效率太低,客户端发数据,服务器端的readyRead信号延时约100ms(看QT源码,发现里面用的是100ms定时器来检测信号),后来自己照着QLocalSocket的思路封装了windows的命名管道,采用多线程来接收数据,在本机上测试通过,通信效率有明显改善。-To do more client and server-side two-way communication, using QLocalSocket/QLocalServer to achieve them simple, but the communication efficiency is too low, the client made the data, the server-side readyRead the signal delay of about 100ms (see QT source code found inside using a 100ms timer device to detect the signal), and later their shining QLocalSocket encapsulates the idea of windows named pipes, using multiple threads to receive data, tested on this machine, the communication efficiency has clearly improved.

下载说明:请别用迅雷下载,失败请重下,重下不扣分!

发表评论

0 个回复

  • 696524资源总数
  • 103945会员总数
  • 46今日下载