#ifndef MTCPSOCKETCONTROL_H
#define MTCPSOCKETCONTROL_H

#include <QObject>
#include "MTcpSocket.h"
#include <QThread>

class MTcpSocketControl : public QObject
{
    Q_OBJECT
public:
    explicit MTcpSocketControl(MsgHandle handle = nullptr, QObject *parent = nullptr);
    ~MTcpSocketControl();
signals:
    void connectSocket(const QString& ip, quint16 port);
    void initSocket(qintptr handle);
    void sendData(const QString& data);
    void recvData(const QString& data);
    void sendFail();

private:
    MTcpSocket* m_socket = nullptr;
    QThread* m_thread = nullptr;
};

#endif // MTCPSOCKETCONTROL_H
