ftpcontrolchannel.h Example File
ftpclient/ftpcontrolchannel.h
#ifndef FTPCONTROLCHANNEL_H
#define FTPCONTROLCHANNEL_H
#include <QObject>
#include <QTcpSocket>
#include <QHostAddress>
class FtpControlChannel : public QObject
{
Q_OBJECT
public:
explicit FtpControlChannel(QObject *parent = nullptr);
void connectToServer(const QString &server);
void command(const QByteArray &command, const QByteArray ¶ms);
signals:
void opened(const QHostAddress &localAddress, int localPort);
void closed();
void info(const QByteArray &info);
void reply(int code, const QByteArray ¶meters);
void invalidReply(const QByteArray &reply);
private:
void onReadyRead();
QTcpSocket m_socket;
QByteArray m_buffer;
};
#endif // FTPCONTROLCHANNEL_H