#ifndef TCPCLIENT_H
#define TCPCLIENT_H

#include <QTcpSocket>
#include <QObject>
#include <QJsonObject>
#include <QJsonDocument>

#define STREAM_MESSAGE "random_alarm"
#define STREAM_PORT  5999

class TcpClient : public QObject {
    Q_OBJECT
public:
    explicit TcpClient(const QString& ip, qint16 port, QObject* parent = nullptr);
    ~TcpClient();
    void releaseSocket();
    bool sendData(const char* data);
    bool isConnect();
signals:

private:
    QTcpSocket* m_socket = nullptr;
    const QString m_ip;
    qint16 m_port;
};

#endif // TCPCLIENT_H
