This repository has been archived on 2024-10-24. You can view files and clone it, but cannot push or open issues or pull requests.
NG_2024_Stanislav_Mykhailenko/Lesson_6/Task_1/Server/server.h
Stanislav Mykhailenko 1af9c40b2a
Add Lesson 6 Task 1
2024-07-29 15:03:10 +03:00

38 lines
631 B
C++

#ifndef SERVER_H
#define SERVER_H
#include <QObject>
#include <QDataStream>
#include <QFile>
#include <QTcpServer>
#include <QTcpSocket>
#include <QDebug>
#include <QVector>
class Server : public QObject
{
Q_OBJECT
public:
explicit Server(QObject *parent = nullptr);
~Server();
public slots:
void start(QString host, int port);
private slots:
void newClient();
void leftClient();
void messageFromClient();
signals:
private:
QTcpServer *m_server = nullptr;
QVector<QTcpSocket *> m_clients;
bool isInfoGot = false;
QString fileName;
int fileSize;
signals:
};
#endif // SERVER_H