I never got an answer to my question, "How does sendHttpResponse() get called?" ..but anyway, I assume it gets called in consequence of the socket emitting a certain signal. Slots in a QThread object get executed in the thread where it lives in (that is the thread where it was created in), not in the thread which is being executed in QThread::run(). Check this thread.
In my opinion the easiest solution would be to subclass QTcpSocket and write the functionality (which is currently in XRServerThread slots) into it. Then those slots would automatically get executed in correct thread.
Oh, i am so sorry, i missed that. You are right it's called from a slot. Thanks for the link and everything else My question was answered! Thanks again!
Bookmarks