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

Thiago Macieira thiago at kde.org
Sat May 1 23:31:59 CEST 2010


Em Sábado 1. Maio 2010, às 21.52.52, Gabriele Kahlout escreveu:
>     assert(server->listen(QHostAddress::LocalHost, port));
> 
>     QTcpSocket* clientSocket = new QTcpSocket();
>     clientSocket->connectToHost(QHostAddress::LocalHost, port);
>     assert(clientSocket->waitForConnected());
> 
>     QTcpSocket* serverSocket = server->nextPendingConnection();

I'm pretty sure that serverSocket is 0 here.

>     assert(serverSocket->waitForReadyRead());

Which would cause the crash on this line.

-- 
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/20100501/86edb197/attachment.bin 


More information about the Qt-interest-old mailing list