This repository has been archived on 2026-05-31. You can view files and clone it, but cannot push or open issues or pull requests.
2013-08-24 12:52:38 +02:00

37 lines
612 B
C++

#ifndef SERVER_H
#define SERVER_H
#include <QObject>
#include <QNetworkInterface>
#include <QTcpServer>
#include <QTcpSocket>
class Server : public QObject
{
Q_OBJECT
public:
explicit Server(QObject *parent = 0);
private:
QList<QTcpServer*> m_serverList;
QList<QTcpSocket*> m_clientList;
signals:
void dataLineAvailable(const QByteArray &dataLine);
private slots:
void newClientConnected();
void readPackage();
void clientDisconnected();
public slots:
bool startServer();
bool stopServer();
void sendToAll(QByteArray data);
};
#endif // SERVER_H