Shoudn't it be:
if (!tcpserver->listen(hostadd,23456)) {
QMessageBox::critical(this, tr
("Fortune Server"), tr
("Unable to start the server: %1.").
arg(tcpserver
->errorString
()));
close();
return;
}
QTcpServer *tcpserver;
tcpserver = new QTcpServer(this);
QHostAddress hostadd("192.168.3.89");
if (!tcpserver->listen(hostadd,23456)) {
QMessageBox::critical(this, tr("Fortune Server"), tr("Unable to start the server: %1.").arg(tcpserver->errorString()));
close();
return;
}
To copy to clipboard, switch view to plain text mode
You were checking the return value of the wrong call to listen..
HIH
Johannes
Bookmarks