[Qt-interest] Major bug in QAbstractSocket's methodwaitForReadyRead()

John McClurkin jwm at nei.nih.gov
Thu Jun 25 14:05:12 CEST 2009


Patric wrote:
> Thank you for answer, Srdjan,
> the problem here is that the method don't wait for the timeout, which 
> makes it unsusable. But it's a mistery why somethimes it works, 
> somethimes not.

I don't think that this any mystery. By your own tests, waitForReadyRead 
waits the designated period when the network is functioning correctly, 
but doesn't wait when there is a network error. Isn't this just what the 
documentation below says? In my opinion, this is correct. If you have a 
functioning network, it makes sense to wait because, though the other 
computer may be busy now, it may send data in the next couple of 
seconds. However, if you don't have a functioning network, there will 
never be any data, so why wait?

>>> http://doc.trolltech.com/4.5/qabstractsocket.html#waitForReadyRead
>>
>> "The function returns true if the readyRead() signal is emitted and
>> there is data available for reading; otherwise it returns false (if an
>> error occurred or the operation timed out)."
>>



More information about the Qt-interest-old mailing list