Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
MQTTConnection.h
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file MQTTConnection.h
1 #ifndef __MQTTCONNECTION_H__
2 #define __MQTTCONNECTION_H__
3 
4 #include <string>
5 #include <mosquitto.h>
6 
7 
9 
10  public:
11 
12  MQTTConnection ( const std::string hostname, const std::string topic, const int port=1883);
13  virtual ~MQTTConnection();
14 
15  virtual int Status() const { return _status;};
16  virtual std::string GetHostName() const { return _hostname;};
17  virtual int GetPort() const { return _port;};
18 
19  virtual int send(const std::string message);
20 
21  protected:
22 
23  int OpenConnection();
24  int CloseConnection();
25 
28  int _status;
29  int _port;
30 
31  struct mosquitto *mosq;
32 
33 };
34 
35 #endif