[Qt-interest] Why Bus error clientSocket->waitForConnected()?

Thiago Macieira thiago at kde.org
Sun May 2 17:17:22 CEST 2010


Em Domingo 2. Maio 2010, às 13.56.44, Kustaa Nyholm escreveu:
> I guess I did not make myself clear.
> 
> My point was that a readLine that does not read a line is pretty much
> useless as such. If I want to read a line I want to read a line and I
> only want it to return in case there is no hope of ever reading a line,
> ie there is an underlaying IO error or end of stream/file.

That's why canReadLine() exists. You shouldn't call readLine() unless you can 
read a line.

> Strange API design in my view.
> 
> Sure I can work around that and write my own readLine or what ever
> I need but what is the point of providing a readLine that does not
> read a line....

It does read a line. What it doesn't do is *block* until more bytes are 
available. Only functions called "waitFor" block.

-- 
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
  Senior Product Manager - Nokia, Qt Development Frameworks
      PGP/GPG: 0x6EF45358; fingerprint:
      E067 918B B660 DBD1 105C  966C 33F5 F005 6EF4 5358
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 190 bytes
Desc: This is a digitally signed message part.
Url : http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20100502/9d403d1a/attachment.bin 


More information about the Qt-interest-old mailing list