16,213
社区成员
发帖
与我相关
我的任务
分享
void QGHTcpServer::incomingConnection(int socketDescriptor)
{
QTcpSocket *pSock = new QTcpSocket(this);
if (!pSock->setSocketDescriptor(socketDescriptor)) {
emit evt_SocketError(pSock,pSock->error());
return;
}else{
connect(pSock, SIGNAL(readyRead()),this, SLOT(new_data_recieved()));
connect(pSock, SIGNAL(disconnected()),this,SLOT(client_closed()));
connect(pSock, SIGNAL(error(QAbstractSocket::SocketError)),this, SLOT(displayError(QAbstractSocket::SocketError)));
connect(pSock, SIGNAL(bytesWritten(qint64)), this, SLOT(some_data_sended(qint64)));
m_clientList[pSock] = 0;
emit evt_NewClientConnected(pSock);
}
}