[Interest] Using QWebSocketServer in a thread other than the GUI thread?

Rainer Wiesenfarth Rainer_Wiesenfarth at trimble.com
Wed May 27 09:43:28 CEST 2015


(Qt 5.3.2 Windows msvc-2010 64bit)

I would like to add a QWebSocketServer to an existing application. I 
would like to have all its operation handled by a thread different from 
the GUI thread to get communication separated from the GUI part.

However, when I use moveToThread with the QWebServerSocket, I get these 
warnings on incoming connections:

   QObject: Cannot create children for a parent that is in a different
     thread.
     (Parent is QNativeSocketEngine(0x1b12ab0),
       parent's thread is QThread( GUI_thread ),
       current thread is QThread( communication_thread )

In addition, the disconnect event never comes through, probably as a 
consequence of the warning.

Question: Is it possible to use QWebSocketServer in a thread other than 
the GUI thread? How?

Best Regards / Mit freundlichen Grüßen
Rainer Wiesenfarth

-- 
Software Engineer | Trimble Imaging Division
Rotebühlstraße 81 | 70178 Stuttgart | Germany
Office +49 711 22881 0 | Fax +49 711 22881 11
http://www.trimble.com/imaging/ | http://www.inpho.de/

Trimble Germany GmbH, Am Prime Parc 11, 65479 Raunheim
Eingetragen beim Amtsgericht Darmstadt unter HRB 83893,
Geschäftsführer: Dr. Frank Heimberg, Hans-Jürgen Gebauer

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4255 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20150527/7437a11d/attachment.bin>


More information about the Interest mailing list