summaryrefslogtreecommitdiffstats
path: root/common/listener.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'common/listener.cpp')
-rw-r--r--common/listener.cpp9
1 files changed, 0 insertions, 9 deletions
diff --git a/common/listener.cpp b/common/listener.cpp
index 8ec9b3e..96d87be 100644
--- a/common/listener.cpp
+++ b/common/listener.cpp
@@ -33,7 +33,6 @@
33 33
34#include <QLocalSocket> 34#include <QLocalSocket>
35#include <QTimer> 35#include <QTimer>
36#include <QLockFile>
37 36
38Listener::Listener(const QByteArray &resourceInstanceIdentifier, QObject *parent) 37Listener::Listener(const QByteArray &resourceInstanceIdentifier, QObject *parent)
39 : QObject(parent), 38 : QObject(parent),
@@ -48,15 +47,7 @@ Listener::Listener(const QByteArray &resourceInstanceIdentifier, QObject *parent
48 this, &Listener::acceptConnection); 47 this, &Listener::acceptConnection);
49 Trace() << "Trying to open " << m_resourceInstanceIdentifier; 48 Trace() << "Trying to open " << m_resourceInstanceIdentifier;
50 49
51 m_lockfile = new QLockFile(m_resourceInstanceIdentifier + ".lock");
52 m_lockfile->setStaleLockTime(0);
53 if (!m_lockfile->tryLock(0)) {
54 Warning() << "Failed to acquire exclusive lock on socket.";
55 exit(-1);
56 }
57
58 if (!m_server->listen(QString::fromLatin1(m_resourceInstanceIdentifier))) { 50 if (!m_server->listen(QString::fromLatin1(m_resourceInstanceIdentifier))) {
59 // FIXME: multiple starts need to be handled here
60 m_server->removeServer(m_resourceInstanceIdentifier); 51 m_server->removeServer(m_resourceInstanceIdentifier);
61 if (!m_server->listen(QString::fromLatin1(m_resourceInstanceIdentifier))) { 52 if (!m_server->listen(QString::fromLatin1(m_resourceInstanceIdentifier))) {
62 Warning() << "Utter failure to start server"; 53 Warning() << "Utter failure to start server";