I’ve created a QThread and in run method i have a QTcpSocket variable. It successfully send data to the client. But when the program exit from run function, and I create another thread with the same socket descriptor it fails to send data. The error is : “Invalid Socket Descriptor”. It seems that the first QTcpSocket is not deleted correctly and it uses the port so the second thread with the same port can not open it. Please Advice.