满意答案
clk2007
2014.03.11
采纳率:53% 等级:11
已帮助:8458人
你是怎么确定只能收到一次的? 你看一下tcpsocket的状态是否是error啊。
手册中是这么说的:
This signal is emitted once every time new data is available for reading from the device. It will only be emitted again once new data is available, such as when a new payload of network data has arrived on your network socket, or when a new block of data has been appended to your device.
意思是readyread信号在且只在有新数据到达时才会被发射。需要注意的是readyread并不是递归的(readyRead() is not emitted recursively)。
所以在收到新数据的时候只要你没有解除链接,那么这个就一直存在,除非socket状态编程error或者closingstatus等特殊状态。
00分享举报