MrHyde
Défi DVP 2
server.h
Go to the documentation of this file.
00001 #ifndef SERVER_H
00002 #define SERVER_H
00003 
00004 #include <QObject>
00005 #include "servernode.h"
00006 #include "sql.h"
00007 #include "config.h"
00008 
00009 QT_BEGIN_NAMESPACE
00010 class QTimer;
00011 class QTcpServer;
00012 class QNetworkSession;
00013 class QTextStream;
00014 QT_END_NAMESPACE
00015 
00016 
00017 class Server : public QObject
00018 {
00019     Q_OBJECT
00020 public:
00021     explicit Server(bool isLocal, QObject *parent = 0);
00022     bool isLocalMode;
00023     void prepare();
00024 
00025 private slots:
00026     void sessionOpened();
00027     void acceptConnection();
00028     void sendMessage(const QString &msg);
00029 
00030 private:
00031     QTimer *timer;
00032     QTcpServer *tcpServer;
00033     QNetworkSession *networkSession;
00034     Sql sql;
00035 };
00036 
00037 #endif // SERVER_H
 All Classes Files Functions Variables