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


Ignore:
Timestamp:
Jul 26, 2008, 10:10:54 AM (16 years ago)
Author:
mervart
Message:

* empty log message *

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/bncapp.cpp

    r973 r974  
    597597//
    598598////////////////////////////////////////////////////////////////////////////
    599 void bncApp::slotNewCorrLine(QString line, QString staID) {
    600   if (_socketsCorr) {
    601     QMutableListIterator<QTcpSocket*> is(*_socketsCorr);
    602     while (is.hasNext()) {
    603       QTcpSocket* sock = is.next();
    604       if (sock->state() == QAbstractSocket::ConnectedState) {
    605         if (sock->write(QString(line + " " + staID + "\n").toAscii()) == -1) {
    606           delete sock;
    607           is.remove();
    608         }
    609       }
    610       else if (sock->state() != QAbstractSocket::ConnectingState) {
     599void bncApp::slotNewCorrLine(QString line, QString staID, long coTime) {
     600
     601  QMutexLocker locker(&_mutex);
     602
     603  if (!_socketsCorr) {
     604    return;
     605  }
     606
     607  // First time, set the _lastDumpSec immediately
     608  // --------------------------------------------
     609  if (_lastDumpCoSec == 0) {
     610    _lastDumpCoSec = coTime - 1;
     611  }
     612
     613  QMutableListIterator<QTcpSocket*> is(*_socketsCorr);
     614  while (is.hasNext()) {
     615    QTcpSocket* sock = is.next();
     616    if (sock->state() == QAbstractSocket::ConnectedState) {
     617      if (sock->write(QString(line + " " + staID + "\n").toAscii()) == -1) {
    611618        delete sock;
    612619        is.remove();
    613620      }
    614621    }
    615   }
    616 }
     622    else if (sock->state() != QAbstractSocket::ConnectingState) {
     623      delete sock;
     624      is.remove();
     625    }
     626  }
     627}
Note: See TracChangeset for help on using the changeset viewer.