[Qt-interest] Why Bus error clientSocket->waitForConnected()?
Gabriele Kahlout
gabriele at mysimpatico.com
Sat May 1 23:52:31 CEST 2010
you guessed right, it's 0x0.
While the reason seems evident to you, I think it's because my attempt to
reduce my multithreaded problem into a short main().
What is your reason?
2010/5/1 Thiago Macieira <thiago at kde.org>
> 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
>
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest
>
>
--
Regards,
K. Gabriele
--- unchanged since 25/1/10 ---
P.S. Unless a notification (LON), please reply either with an answer OR with
" ACK" appended to this subject within 48 hours. Otherwise, I might resend.
In(LON, this) ∨ In(48h, TimeNow) ∨ ∃x. In(x, MyInbox) ∧ IsAnswerTo(x, this)
∨ (In(subject(this), subject(x)) ∧ In(ACK, subject(x)) ∧
¬IsAnswerTo(x,this)) ⇒ ¬IResend(this).
Also note that correspondence may be received only from specified a priori
senders, or if the subject of this email ends with a code, eg. -LICHT01X,
then also from senders whose reply contains it.
∀x. In(x, MyInbox) ⇒ In(senderAddress(x), MySafeSenderList) ∨ (∃y. In(y,
subject(this) ) ∧ In(y,x) ∧ isCodeLike(y, -LICHT01X) ).
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20100501/16a31ab9/attachment.html
More information about the Qt-interest-old
mailing list