Changeset 2105 in ntrip for trunk/BNC/bncapp.cpp


Ignore:
Timestamp:
Dec 8, 2009, 10:49:57 AM (14 years ago)
Author:
mervart
Message:

* empty log message *

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/bncapp.cpp

    r2011 r2105  
    639639  QMutexLocker locker(&_mutex);
    640640
    641   if (!_socketsCorr) {
    642     return;
    643   }
    644 
    645641  bncSettings settings;
    646642  _waitCoTime    = settings.value("corrTime").toInt();
     
    683679    QList<QString> allCorrs = _corrs->values(sec);
    684680    emit newCorrections(allCorrs);
    685     QListIterator<QString> it(allCorrs);
    686     while (it.hasNext()) {
    687       QString corrLine = it.next() + "\n";
    688 
    689       QMutableListIterator<QTcpSocket*> is(*_socketsCorr);
    690       while (is.hasNext()) {
    691         QTcpSocket* sock = is.next();
    692         if (sock->state() == QAbstractSocket::ConnectedState) {
    693           if (sock->write(corrLine.toAscii()) == -1) {
     681    if (_socketsCorr) {
     682      QListIterator<QString> it(allCorrs);
     683      while (it.hasNext()) {
     684        QString corrLine = it.next() + "\n";
     685     
     686        QMutableListIterator<QTcpSocket*> is(*_socketsCorr);
     687        while (is.hasNext()) {
     688          QTcpSocket* sock = is.next();
     689          if (sock->state() == QAbstractSocket::ConnectedState) {
     690            if (sock->write(corrLine.toAscii()) == -1) {
     691              delete sock;
     692              is.remove();
     693            }
     694          }
     695          else if (sock->state() != QAbstractSocket::ConnectingState) {
    694696            delete sock;
    695697            is.remove();
    696698          }
    697         }
    698         else if (sock->state() != QAbstractSocket::ConnectingState) {
    699           delete sock;
    700           is.remove();
    701699        }
    702700      }
Note: See TracChangeset for help on using the changeset viewer.