#ifndef CLIENTBASE_H
#define CLIENTBASE_H

#include <QObject>
#include <QTcpSocket>
#include <QHostAddress>
#include <QByteArray>
#include "message.h"


class ClientBase : public QObject
{
    Q_OBJECT
public:
    explicit ClientBase(QObject *parent = 0);
    ~ClientBase();
    void closeConnection();
    QString getStatus();
    void send(const QByteArray &ba);

public slots:

protected:
    QTcpSocket * m_socket;

protected slots:
    virtual void readData();
    virtual void Disconnection();

signals:
    void disconnected();
    void receive(QByteArray ba);

};

#endif // CLIENTBASE_H
