Not only that, but if you want to use Qt's signals and slot mechanism, you HAVE to call exec() in the threads run() method otherwise the thread has no event loop. (Well, I suppose you could implement an event loop yourself but that yould be nasty). So ditch the while loop and jsut call exec() in the thread's run() method. Handle all of the signal's emitted by the socket in socket.cpp (or whatever the name of your subclassed QTcpSocket is). Connect all the signals and slots in the constructor of your QTcpSocket subclass (or in the run() method of your thread, but personally I find that messy). I can't get any clearer than that
If you want an example, see http://knewz.svn.sourceforge.net/vie...ewz/trunk/src/ Look at the classes connection.h/cpp and socket.h/cpp and see how I implemented this there.
Bookmarks