24 lines
384 B
C
24 lines
384 B
C
|
#pragma once
|
||
|
|
||
|
#include <QObject>
|
||
|
#include <zmq.hpp>
|
||
|
|
||
|
class ZMQClient : public QObject {
|
||
|
Q_OBJECT
|
||
|
|
||
|
public:
|
||
|
explicit ZMQClient(QObject* parent = nullptr);
|
||
|
~ZMQClient() override;
|
||
|
|
||
|
bool ConnectToServer(const QString& address);
|
||
|
|
||
|
bool Send(const QString& message);
|
||
|
|
||
|
Q_SIGNALS:
|
||
|
void MessageReceivered(const QString& message);
|
||
|
|
||
|
|
||
|
private:
|
||
|
zmq::context_t ctx_;
|
||
|
zmq::socket_t socket_;
|
||
|
};
|