i tried using QHostAddress to initialse my QTcpServer object but whenever i start the server i get an error unable to start the server.
this is the code for initialising the server
tcpserver->listen(hostadd,23456);
if (!tcpserver->listen()) {
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");
tcpserver->listen(hostadd,23456);
if (!tcpserver->listen()) {
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
when i compile i get no error.
is this correct??? please help me
thanx in advance
Bookmarks