last changes
This commit is contained in:
37
AdServer/server.h
Normal file
37
AdServer/server.h
Normal file
@@ -0,0 +1,37 @@
|
||||
#ifndef SERVER_H
|
||||
#define SERVER_H
|
||||
|
||||
#include <QObject>
|
||||
#include <QTcpServer>
|
||||
#include <QNetworkInterface>
|
||||
#include <QStringList>
|
||||
#include "connection.h"
|
||||
|
||||
|
||||
class Server : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit Server(QObject *parent = 0);
|
||||
QStringList getIpList();
|
||||
void startServer(QHostAddress);
|
||||
void stopServer();
|
||||
QString getStatus();
|
||||
void send(const QByteArray &ba);
|
||||
|
||||
private:
|
||||
QTcpServer * m_server;
|
||||
QList <Connection*> clients;
|
||||
int next_conn_id;
|
||||
|
||||
private slots:
|
||||
void newConnection();
|
||||
void connectionClosed();
|
||||
void received(QByteArray ba);
|
||||
|
||||
signals:
|
||||
void receiveData(QByteArray ba);
|
||||
|
||||
};
|
||||
|
||||
#endif // SERVER_H
|
||||
Reference in New Issue
Block a user