Superviseur - Collecteur 1.0
Ce logiciel correspond au collecteur de la suite des trois logiciels composant le superviseur
afficheursocket.cpp
Aller à la documentation de ce fichier.
00001 #include "afficheursocket.h"
00002 
00003 
00005 
00010 AfficheurSocket::AfficheurSocket(quint16 port, QObject *parent) :
00011     QTcpServer(parent)
00012 {
00013     this->listen(QHostAddress::Any, port);
00014 }
00015 
00016 
00018 
00025 void AfficheurSocket::incomingConnection(int socketDescriptor){
00026     qDebug() << "Nouvelle connexion : " << socketDescriptor;
00027     AfficheurSocketThread *thread = new AfficheurSocketThread(socketDescriptor);
00028     QThread *th = new QThread();
00029     thread->moveToThread(th);
00030     connect(this, SIGNAL(nouvellesDonnees(QString)), thread, SLOT(receptionDonnees(QString)));
00031     connect(thread, SIGNAL(destroyed()), th, SLOT(quit()));
00032     th->start();
00033 }
00034 
00035 
00037 
00041 void AfficheurSocket::receptionDonnees(QString donnees){
00042     emit nouvellesDonnees(donnees);
00043 }
 Tout Classes Fichiers Fonctions Variables Macros