QTfrontend/tcpBase.cpp
changeset 291 afa378f1e961
parent 197 8a7123b84d1b
child 379 e4cd3cd209c6
equal deleted inserted replaced
290:09738170c557 291:afa378f1e961
    33   IPCSocket(0)
    33   IPCSocket(0)
    34 {
    34 {
    35   if(!IPCServer) {
    35   if(!IPCServer) {
    36     IPCServer = new QTcpServer(this);
    36     IPCServer = new QTcpServer(this);
    37     IPCServer->setMaxPendingConnections(1);
    37     IPCServer->setMaxPendingConnections(1);
    38     if (!IPCServer->listen(QHostAddress::LocalHost, IPC_PORT)) {
    38     if (!IPCServer->listen(QHostAddress::LocalHost)) {
    39       QMessageBox::critical(0, tr("Error"),
    39       QMessageBox::critical(0, tr("Error"),
    40 			    tr("Unable to start the server: %1.")
    40 			    tr("Unable to start the server: %1.")
    41 			    .arg(IPCServer->errorString()));
    41 			    .arg(IPCServer->errorString()));
       
    42       exit(0); // FIXME - should be graceful exit here
    42     }
    43     }
    43   }
    44   }
       
    45   ipc_port=IPCServer->serverPort();
    44 }
    46 }
    45 
    47 
    46 void TCPBase::NewConnection()
    48 void TCPBase::NewConnection()
    47 {
    49 {
    48   if(IPCSocket) {
    50   if(IPCSocket) {