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

Patric userqt at gmail.com
Wed Jun 24 23:41:30 CEST 2009


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.
Anyway, I have found workaround for this situation. But it's very helpful 
method.

Best regards,
Patric



----- Original Message ----- 
From: "Srdjan Todorovic" <todorovic.s at googlemail.com>
To: "qt-interest" <qt-interest at trolltech.com>
Sent: Thursday, June 25, 2009 12:36 AM
Subject: Re: [Qt-interest] Major bug in QAbstractSocket's 
methodwaitForReadyRead()


> Hi,
>
> 2009/6/24 Patric <userqt at gmail.com>:
>
>> I have a sniffer program, more specifically Wireshark. There I can see my
>> requests and my responses. The problem is, that according to that code up
>> there it should wait 5 seconds for the new package. But there are 
>> situations
>> when it don't wait, it just returns false. I'm talking for the
>> waitForReadyRead method. So here are the situations :
>
> Do you also run Wireshark with the cable disconnected? What does it
> show in that situation?
>
>> 2. My cable IS NOT plugged. The first setRequest is unsuccessful, so it
>> waits 5 seconds and continues with the second. But here ! it don't wait 5
>> seconds, it immediately returns FALSE. Which I think is not correct.
>
> All I can think of right now is:
>
> 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)."
>
> Perhaps the readyRead() signal was not emitted?
>
> "If an error occured" could be:
>
> http://doc.trolltech.com/4.5/qabstractsocket.html#SocketError-enum
>
> Specifically:
> QAbstractSocket::NetworkError 7 An error occurred with the network
> (e.g., the network cable was accidentally plugged out).
>
> Which could explain what you are observing.
>
> Good luck,
> Srdjan
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest
> 




More information about the Qt-interest-old mailing list