程序中,设定机制
connect(firstServer, SIGNAL(error(QAbstractSocket::SocketError)), this, SLOT(connectToSeconed(QAbstractSocket::SocketError )));
在连接firstServer过程( connectToFirst() )中,想连接一秒后自动提示连接不上,转为连接secondServer ( connectToSeconed() ) ,
实现如下
{
firstServer->connectToHost(firstIP, firstPort, QIODevice::ReadWrite);
if(!firstServer->waitForConnected(1000))
emit firstServer->error();
return;
}
请问为何connectToSeconed(QAbstractSocket::SocketError ) 不会被激发呢?