[Qt-interest] slot connected to QAbstractSocket::QIODevice::readyRead() recieves multiple responses at once

Neel Basu neel.basu.z at gmail.com
Wed Apr 15 13:48:31 CEST 2009


Suppose I am sending
---> Request1 CRLF
Server will responding the following multiple messages on that Request1
<--- Response1 CRLF
<--- Response2 CRLF
<--- Response3 CRLF
Now readyRead() should emit 3 times
But SOMETIMES (rare but not so rare to ignore) readyRead() emits less than 3 
times

sometimes it emits just Once for all these three Responses and If I invoke 
readAll() it returns Response1 CRLF Response2 CRLF Response3 CRLF as one 
response

Its not possible to distinguish them anyway other than CRLF.

But its not Mandatory for a Protocol to end all of its messages with CRLF (* I 
am not sure on this point Please Correct me If I am wrong)

So Whats the general solution to separate them.
However If I am wrong on the above point then its possible just to Split them 
by CRLF

Thanks
Neel



More information about the Qt-interest-old mailing list