QCAD
Open Source 2D CAD
RLocalPeer.h
Go to the documentation of this file.
1 
20 #ifndef RLOCALPEER_H
21 #define RLOCALPEER_H
22 
23 #include "core_global.h"
24 
25 #include <QLocalServer>
26 #include <QLocalSocket>
27 #include <QDir>
28 
29 #include "RLockedFile.h"
30 
31 class QCADCORE_EXPORT RLocalPeer : public QObject {
32  Q_OBJECT
33 
34 public:
35  RLocalPeer(QObject* parent=0, const QString& appId = QString());
36  bool isClient();
37  bool sendMessage(const QString &message, int timeout);
38  QString applicationId() const {
39  return id;
40  }
41 
42 signals:
43  void messageReceived(const QString& message);
44 
45 protected slots:
46  void receiveConnection();
47 
48 protected:
49  QString id;
50  QString socketName;
51  QLocalServer* server;
53 
54 private:
55  static const char* ack;
56 };
57 
58 #endif
#define QCADCORE_EXPORT
Definition: core_global.h:10
QString socketName
Definition: RLocalPeer.h:50
static const char * ack
Copyright (c) 2011-2015 by Andrew Mustun.
Definition: RLocalPeer.h:55
RLockedFile lockFile
Definition: RLocalPeer.h:52
QString id
Definition: RLocalPeer.h:49
QLocalServer * server
Definition: RLocalPeer.h:51
QString applicationId() const
Definition: RLocalPeer.h:38
Copyright (c) 2011-2015 by Andrew Mustun.
Definition: RLocalPeer.h:31
Copyright (c) 2011-2015 by Andrew Mustun.
Definition: RLockedFile.h:30