void Chat::socketServer()
{
serverBool = true;
server = new QTcpServer(this);
serverSocket = new QTcpSocket(this);
server->listen(QHostAddress::Any, port);
//connect(server, SIGNAL(newConnection()), this, SLOT(newConnectionSlot()));
serverThread *thread = new serverThread(socketDescriptor, content, this);
connect(thread, SIGNAL(newConnection()), thread, SLOT(newConnectionSlot()));
thread->start();
content = writeMessageEdit->toPlainText();
}
做了一个tcp的聊天程序,想实现一对多,多对多聊天,于是使用了线程,但是好象没什么反应,连都连不上了。是不是有什么特别的设置或者程序错误。现在有点头晕,都不知道从何查起。
请求高手指教