Hi.

I need to write a multi-threading QTcpServer only with QCoreApplication.

This is my main() function:

Qt Code:
  1. int main(int argc, char *argv[]){
  2. QCoreApplication app(argc, argv);
  3. Server server;
  4.  
  5. message("Server init...");
  6. if(!server.listen(QHostAddress::Any, port)){
  7. message("Server can't be initiated");
  8.  
  9. return -1;
  10. }
  11. message("Server initiated");
  12. while(server.isListening());
  13. message("Server closed");
  14.  
  15. return 0;
  16. }
To copy to clipboard, switch view to plain text mode 

But it nevers enters in the Server::incomingConnection(int socketDescriptor) function. I suspect that the problem is with while(server.isListening()); but I haven't found any example for QtCore apps, only for QtGui

Thanks