MCPcopy Create free account
hub / github.com/CE-Programming/CEmu / ipcCloseConnected

Method ipcCloseConnected

gui/qt/mainwindow.cpp:2664–2698  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2662}
2663
2664void MainWindow::ipcCloseConnected() {
2665 QString idPath = configPath + "/id/";
2666 QDir dir(idPath);
2667 QStringList clients = dir.entryList(QDir::Filter::Files);
2668 int delay = 100;
2669
2670 foreach (const QString &id, clients) {
2671 QFile file(idPath + id);
2672 if (file.open(QIODevice::ReadOnly)) {
2673 QTextStream stream(&file);
2674 QString pid = stream.readLine();
2675 if (!isProcRunning(static_cast<pid_t>(pid.toLongLong()))) {
2676 file.close();
2677 file.remove();
2678 continue;
2679 } else {
2680 if (opts.pidString != pid) {
2681 QByteArray byteArray;
2682 QDataStream dataStream(&byteArray, QIODevice::WriteOnly);
2683 dataStream.setVersion(QDataStream::Qt_5_5);
2684 unsigned int type = IPC_CLOSE;
2685 stream << type;
2686
2687 com.clientSetup(pid);
2688 com.send(byteArray);
2689 delay += 100;
2690 }
2691 }
2692 }
2693 file.close();
2694 }
2695
2696 // wait for the settings to be written by the other processes
2697 guiDelay(delay);
2698}
2699
2700void MainWindow::ipcReceived() {
2701 QByteArray byteArray(com.getData());

Callers

nothing calls this directly

Calls 1

guiDelayFunction · 0.85

Tested by

no test coverage detected