Changeset 260 in flair-src for trunk/tools/FlairGCS/src/Manager.cpp


Ignore:
Timestamp:
07/26/18 14:44:42 (3 years ago)
Author:
Sanahuja Guillaume
Message:

gcs: do not use socket if connection lost

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/FlairGCS/src/Manager.cpp

    r255 r260  
    154154  connect(newLayout, SIGNAL(destroyed(QObject *)), this, SLOT(layoutDestroyed(QObject *)));
    155155  connect(udtSocket, SIGNAL(destroyed(QObject *)), this, SLOT(udtSocketDestroyed(QObject *)));
     156  connect(udtSocket, SIGNAL(destroyed(QObject *)), newLayout, SLOT(udtSocketDestroyed(QObject *)));
    156157 
    157158  // widget
     
    187188void Manager::udtSocketDestroyed(QObject *obj) {
    188189  //mark socket as not valid, it can be a connection lost
    189   //in this case we keep the layout for reading, and mark it as problematic
     190  //in this case we keep the layout for reading, and mark it as problematic (socket=NULL)
    190191  for(int i=0;i<connections.count();i++) {
    191192    if(connections.at(i).socket==(UdtSocket *)obj) {
     
    391392void Manager::send(void) {
    392393  for (int i = 0; i < connections.count(); i++) {
    393     QDomDocument doc("remote_ui_xml");
    394     connections.at(i).layout->GetUpdateXml((QDomElement *)&doc);
    395     // fprintf(stderr,"merge\n%s\n",doc.toString().toLocal8Bit().constData());
    396 
    397     connections.at(i).layout->XmlToSend(doc);
     394    if(connections.at(i).socket!=NULL) {
     395      QDomDocument doc("remote_ui_xml");
     396      connections.at(i).layout->GetUpdateXml((QDomElement *)&doc);
     397      // fprintf(stderr,"merge\n%s\n",doc.toString().toLocal8Bit().constData());
     398
     399      connections.at(i).layout->XmlToSend(doc);
     400    }
    398401  }
    399402}
Note: See TracChangeset for help on using the changeset viewer.