资 源 简 介
做多客户端与服务器端的双向通信,采用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.