QTfrontend/tcpBase.cpp
changeset 291 afa378f1e961
parent 197 8a7123b84d1b
child 379 e4cd3cd209c6
--- a/QTfrontend/tcpBase.cpp	Thu Dec 07 21:24:58 2006 +0000
+++ b/QTfrontend/tcpBase.cpp	Fri Dec 08 21:14:52 2006 +0000
@@ -35,12 +35,14 @@
   if(!IPCServer) {
     IPCServer = new QTcpServer(this);
     IPCServer->setMaxPendingConnections(1);
-    if (!IPCServer->listen(QHostAddress::LocalHost, IPC_PORT)) {
+    if (!IPCServer->listen(QHostAddress::LocalHost)) {
       QMessageBox::critical(0, tr("Error"),
 			    tr("Unable to start the server: %1.")
 			    .arg(IPCServer->errorString()));
+      exit(0); // FIXME - should be graceful exit here
     }
   }
+  ipc_port=IPCServer->serverPort();
 }
 
 void TCPBase::NewConnection()