[Interest] ThreadedFortune example extending to send message forever

Konstantin Shegunov kshegunov at gmail.com
Tue Sep 6 12:53:16 CEST 2016


On Mon, Sep 5, 2016 at 7:17 PM, Nilesh Kokane <nilesh.kokane05 at gmail.com>
wrote:
>
> I played with the ThreadFortune server and found that when I commented
> disconnectFromHost() & waitForDisconnected() from the thread and
> instead call  exec(), then I get readReady signal from the client end.
> But when I don't call exec I dont.
>
> In the original example, How does disconnectFromHost() triggers
> readyRead signal?


You're blocking the event loop for the thread, so no queued slot
invocations will be made until you return control to the event loop ... and
since you don't have one that runs all the time ...
In the original example, if memory serves me, there's no need to deliver
slot calls, so there's no need to have a thread event loop.

By the way, in the thread you stared on the Qt forum I did provide you with
a full-fledged working threaded TCP examplethat uses the async API, have
you looked at it?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20160906/8bbd64fa/attachment.html>


More information about the Interest mailing list