void CSocketMng::addConnection(const qintptr &socketDescriptor) { CSocket *socket = new CSocket(this); socket->setSocketDescriptor(socketDescriptor); connect(socket, SIGNAL(disconnected(CSocket*)), this, SLOT(onSocketDisconnected(CSocket*))); connect(socket, SIGNAL(netReceiveData(QString,int)), this, SLOT(onNetReceiveData(QString,int))); QString addressPort = socket->hostAddress() + ":" + QString("%1").arg(socket->hostPort()); if (!addSocket(socket, addressPort)) socket->deleteLater(); }