#pragma once #include #include class QTcpServer; class Client; class Server : public QObject { Q_OBJECT public: explicit Server(QObject *parent = nullptr); Q_SIGNALS: void distribute(const QByteArray &data); protected: void timerEvent(QTimerEvent *event) Q_DECL_OVERRIDE; private Q_SLOTS: void newConnection(); private: QTcpServer *m_server; QSet m_clients; int m_timerId; };