Am 29.08.2012 um 16:19 schrieb Abhishek <abhishekwo...@gmail.com>:

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

"You are holding it wrong!" ;)

Qt network management, just like the GUI part, is *event-driven*.

So the only loop that should be running is the Qt event loop.

Your application merely *reacts* to those (network / OS / GUI) events. And 
manages its "state" accordingly.

So one state your server could be in would be "processing": in that case you do 
whatever you would have done in your own loop (again: don't do that!).

At some point you get informed about a "quit" message. From this point on you 
go into the next state "terminating", from which point on you'd ignore any 
subsequent request and do whatever you would have done after your loop (bad! 
bad! bad loop!).


If you're still not convinced you want to read up about the "networking module" 
in Qt (and about Qt event handling in general).

Cheers,
  Oliver

P.S. How or if at all you store your "state" in your application logic is up to 
you - it could remain a "mental model/concept" only.
_______________________________________________
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest

Reply via email to