29 lines
622 B
C++
29 lines
622 B
C++
#ifndef TCPCONNECTIONHANDLER_H
|
|
#define TCPCONNECTIONHANDLER_H
|
|
|
|
#include "TcpRequest.h"
|
|
#include "TcpRequestHandler.h"
|
|
#include <QObject>
|
|
#include <QTcpSocket>
|
|
|
|
class TcpConnectionHandler : public QObject {
|
|
Q_OBJECT
|
|
public:
|
|
explicit TcpConnectionHandler(QTcpSocket* socket, TcpRequestHandler* handler, QObject* parent = nullptr);
|
|
~TcpConnectionHandler();
|
|
|
|
private slots:
|
|
void onReadyRead();
|
|
void onDisconnected();
|
|
|
|
signals:
|
|
void disconnected();
|
|
|
|
private:
|
|
QTcpSocket* socket;
|
|
TcpRequest* request;
|
|
TcpResponse* response;
|
|
TcpRequestHandler* handler;
|
|
};
|
|
|
|
#endif // TCPCONNECTIONHANDLER_H
|