if (!CRserv->listen()) {
tr("Unable to start the server: %1.")
.arg(CRserv->errorString()));
close();
return;
}else{
CRserv->listen( adr, port );
}
if (!CRserv->listen()) {
QMessageBox::critical(this, tr("CR_bypasser"),
tr("Unable to start the server: %1.")
.arg(CRserv->errorString()));
close();
return;
}else{
CRserv->listen( adr, port );
}
To copy to clipboard, switch view to plain text mode
your problem is here, because if/else combination is wrong. When you use listen() and it returns true, then your server is listening on every address and any port. And if it's true then else block would be processed when you call listen() on alredy listening server with different address and port...
Bookmarks