Op 29-8-2012 16:19, Abhishek schreef:
Hello all,
I have a program in which on main thread I have TCP server to receive messages and process on it.
 - on one specific message TCP server start one while infinite loop
 - to stop this loop I have another TCP message

but while in loop I see that I am not able to receive any TCP signals.

I tried adding QCoreApplication::processEvents() in my loop but nothing work.

Please let me know the proper way to handle such situation.
You just have to start an eventloop, instead of sticking in your endless loop. If you use the Qt eventloop, you'll have no problems working with signals and slots in a thread. You do that by calling exec() from your run() method. Instead of using an endless loop, you might want to use things like a 0 timer.

André


Happy Hacking.

--
Abhishek
http://thezeroth.net




_______________________________________________
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest

_______________________________________________
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest

Reply via email to