MCPcopy Create free account
hub / github.com/FreesmTeam/FreesmLauncher / isClient

Method isClient

libraries/LocalPeer/src/LocalPeer.cpp:130–150  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

128}
129
130bool LocalPeer::isClient()
131{
132 if (lockFile->isLocked())
133 return false;
134
135 if (!lockFile->lock(LockedFile::WriteLock, false))
136 return true;
137
138 bool res = server->listen(socketName);
139#if defined(Q_OS_UNIX)
140 // ### Workaround
141 if (!res && server->serverError() == QAbstractSocket::AddressInUseError) {
142 QFile::remove(QDir::cleanPath(QDir::tempPath()) + QLatin1Char('/') + socketName);
143 res = server->listen(socketName);
144 }
145#endif
146 if (!res)
147 qWarning("QtSingleCoreApplication: listen on local socket failed, %s", qPrintable(server->errorString()));
148 QObject::connect(server.get(), SIGNAL(newConnection()), SLOT(receiveConnection()));
149 return false;
150}
151
152bool LocalPeer::sendMessage(const QByteArray& message, int timeout)
153{

Callers 1

ApplicationMethod · 0.80

Calls 5

isLockedMethod · 0.80
listenMethod · 0.80
errorStringMethod · 0.80
lockMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected