MCPcopy Create free account
hub / github.com/Windscribe/Desktop-App / start

Method start

src/client/client-common/ipc/server.cpp:20–49  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

18}
19
20bool Server::start()
21{
22 server_.setSocketOptions(QLocalServer::UserAccessOption);
23
24#if defined(Q_OS_MACOS)
25 const QString runtimeDir = QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) +
26 "/" WS_SETTINGS_ORG "/ipc";
27 QDir runtimeDirObj(runtimeDir);
28 if (!runtimeDirObj.mkpath(".")) {
29 qCCritical(LOG_IPC) << "IPC server could not create runtime directory:" << runtimeDir;
30 return false;
31 }
32 QFile::setPermissions(runtimeDir,
33 QFileDevice::ReadOwner | QFileDevice::WriteOwner | QFileDevice::ExeOwner);
34 const QString path = runtimeDir + "/" WS_PRODUCT_NAME_LOWER "-localipc.sock";
35 QFile::remove(path);
36 bool b = server_.listen(path);
37#elif defined(Q_OS_LINUX)
38 const QString runtimeDir = QStandardPaths::writableLocation(QStandardPaths::RuntimeLocation);
39 const QString path = runtimeDir + "/" WS_PRODUCT_NAME_LOWER "-localipc.sock";
40 QFile::remove(path);
41 bool b = server_.listen(path);
42#else
43 bool b = server_.listen(WS_APP_IDENTIFIER "8rM7bza5OR");
44#endif
45
46 if (!b)
47 qCCritical(LOG_IPC) << "IPC server listen error:" << server_.errorString();
48 return b;
49}
50
51
52void Server::onNewConnection()

Callers 3

getOSDefaultDnsServersFunction · 0.45
initAndSendMethod · 0.45

Calls 1

removeFunction · 0.50

Tested by

no test coverage detected