Hi There,
I use currently Qt 4.5.2
after a long exasperating time of coding I find some very oppositional statements in Qt Documentation.

1.) Qt Assistant QTcpSocket / QAbstractSocket
QTcpSocket hardy no sentence how to with threads
2.) Qt Assistant Threaded Fortune Server Example

Qt Code:
  1. void FortuneThread::run()
  2. {
  3. QTcpSocket tcpSocket;
To copy to clipboard, switch view to plain text mode 
What's worth noticing is that we are creating this object inside the thread, which automatically associates the socket to the thread's event loop. This ensures that Qt will not try to deliver events to our socket from the main thread while we are accessing it from FortuneThread::run().
At this example it seems there ist no need to call "exec()" or, even not to use "exec()" ... will not deliver events to our socket for Main thread !

3.) doc/threads.html and Qthread
hreads to slots in this thread, using a mechanism called queued connections. It also makes it possible to use classes that require the event loop, such as QTimer and QTcpSocket, in the thread.
If somebody reads and takes the Threaded Fortune Server Example he will struggle and fail very hard!

On my specific problem I use
Qt Code:
  1. MyThread::run()
  2. {
  3. while (running)
  4. {
  5. m_pFifio->getData( pBuffer, size );
  6. parseData( pData );
  7.  
  8. ... in some Object living in that thread I Call
  9. qint64 len = pTcpSocket->write ( data, length ) ;
  10.  
  11.  
  12. }
  13. }
To copy to clipboard, switch view to plain text mode 

Where write() writes length bytes of data which never will appears on the other side of the socket ( some other (remote ) client programm ).
One step better will be to append a waitForReadyRead() after write
In deed QTcpSocket sends sends some data, but not complete tough write returns the correct amount of bytes.



For me it dosn`t realy make sense that I have to bind QtcpSocket to event loop!
It should go the normal (classic ) way to !

Does sombody find a solution for this way
regards