No, you can't release a socket descriptor once it has been assigned to a QTcpSocket
.
But I'm not sure you would need to. The QTcpSocket
can usually be moved to another thread with moveToThread
, the constraints are the same as any moved QObject
:
moveToThread
should be called inside the thread to which the object currently belongs,- the object can't have a parent (you can remove it with
theObject->setParent(0);
, or move the parent instead of the object),
and because it is a QTcpSocket
, the receiving thread should be running an event loop or you need to use the waitFor...
functions in that thread.
This note seems to suggest that this only works for sockets since Qt 4.7.