MCPcopy Create free account
hub / github.com/MITK/MITK / isClient

Method isClient

Utilities/qtsingleapplication/qtlocalpeer.cpp:111–132  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

109}
110
111bool QtLocalPeer::isClient()
112{
113 if (lockFile.isLocked())
114 return false;
115
116 if (!lockFile.lock(QtLP_Private::QtLockedFile::WriteLock, false))
117 return true;
118
119 bool res = server->listen(socketName);
120#if defined(Q_OS_UNIX)
121 // ### Workaround
122 if (!res && server->serverError() == QAbstractSocket::AddressInUseError)
123 {
124 QFile::remove(QDir::cleanPath(QDir::tempPath()) + QLatin1Char('/') + socketName);
125 res = server->listen(socketName);
126 }
127#endif
128 if (!res)
129 qWarning("QtSingleCoreApplication: listen on local socket failed, %s", qPrintable(server->errorString()));
130 QObject::connect(server, SIGNAL(newConnection()), SLOT(receiveConnection()));
131 return false;
132}
133
134bool QtLocalPeer::sendMessage(const QByteArray &message, int timeout)
135{

Callers 2

isRunningMethod · 0.80
isRunningMethod · 0.80

Calls 3

isLockedMethod · 0.80
errorStringMethod · 0.80
lockMethod · 0.45

Tested by

no test coverage detected