Index: trunk/BNC/RTCM3/RTCM3coDecoder.cpp
===================================================================
--- trunk/BNC/RTCM3/RTCM3coDecoder.cpp	(revision 973)
+++ trunk/BNC/RTCM3/RTCM3coDecoder.cpp	(revision 974)
@@ -68,6 +68,6 @@
   _out = 0;
 
-  connect(this, SIGNAL(newCorrLine(QString, QString)), 
-          (bncApp*) qApp, SLOT(slotNewCorrLine(QString, QString)));
+  connect(this, SIGNAL(newCorrLine(QString, QString, long)), 
+          (bncApp*) qApp, SLOT(slotNewCorrLine(QString, QString, long)));
 }
 
@@ -175,5 +175,6 @@
                _co.Sat[ii].Orbit.DeltaAlongTrack,
                _co.Sat[ii].Orbit.DeltaCrossTrack);
-        printLine(line);
+        long coTime = GPSweek * 7*24*3600 + long(floor(GPSweeks+0.5));
+        printLine(line, coTime);
       }
       for(int ii = CLOCKORBIT_NUMGPS; 
@@ -186,5 +187,6 @@
                _co.Sat[ii].Orbit.DeltaAlongTrack,
                _co.Sat[ii].Orbit.DeltaCrossTrack);
-        printLine(line);
+        long coTime = GPSweek * 7*24*3600 + long(floor(GPSweeks+0.5));
+        printLine(line, coTime);
       }
       _buffer = _buffer.substr(bytesused);
@@ -202,5 +204,5 @@
 // 
 ////////////////////////////////////////////////////////////////////////////
-void RTCM3coDecoder::printLine(const QString& line) {
+void RTCM3coDecoder::printLine(const QString& line, long coTime) {
   if (_out) {
     *_out << line.toAscii().data() << endl;
@@ -208,4 +210,4 @@
   }
 
-  emit newCorrLine(line, _staID);
-}
+  emit newCorrLine(line, _staID, coTime);
+}
Index: trunk/BNC/RTCM3/RTCM3coDecoder.h
===================================================================
--- trunk/BNC/RTCM3/RTCM3coDecoder.h	(revision 973)
+++ trunk/BNC/RTCM3/RTCM3coDecoder.h	(revision 974)
@@ -45,9 +45,9 @@
 
  signals:
-  void newCorrLine(QString line, QString staID);
+  void newCorrLine(QString line, QString staID, long coTime);
 
  private:
   void reopen();
-  void printLine(const QString& line);
+  void printLine(const QString& line, long coTime);
 
   int                 _port;
Index: trunk/BNC/bncapp.cpp
===================================================================
--- trunk/BNC/bncapp.cpp	(revision 973)
+++ trunk/BNC/bncapp.cpp	(revision 974)
@@ -597,20 +597,31 @@
 // 
 ////////////////////////////////////////////////////////////////////////////
-void bncApp::slotNewCorrLine(QString line, QString staID) {
-  if (_socketsCorr) {
-    QMutableListIterator<QTcpSocket*> is(*_socketsCorr);
-    while (is.hasNext()) {
-      QTcpSocket* sock = is.next();
-      if (sock->state() == QAbstractSocket::ConnectedState) {
-        if (sock->write(QString(line + " " + staID + "\n").toAscii()) == -1) {
-          delete sock;
-          is.remove();
-        }
-      }
-      else if (sock->state() != QAbstractSocket::ConnectingState) {
+void bncApp::slotNewCorrLine(QString line, QString staID, long coTime) {
+
+  QMutexLocker locker(&_mutex);
+
+  if (!_socketsCorr) {
+    return;
+  }
+
+  // First time, set the _lastDumpSec immediately
+  // --------------------------------------------
+  if (_lastDumpCoSec == 0) {
+    _lastDumpCoSec = coTime - 1;
+  }
+
+  QMutableListIterator<QTcpSocket*> is(*_socketsCorr);
+  while (is.hasNext()) {
+    QTcpSocket* sock = is.next();
+    if (sock->state() == QAbstractSocket::ConnectedState) {
+      if (sock->write(QString(line + " " + staID + "\n").toAscii()) == -1) {
         delete sock;
         is.remove();
       }
     }
-  }
-}
+    else if (sock->state() != QAbstractSocket::ConnectingState) {
+      delete sock;
+      is.remove();
+    }
+  }
+}
Index: trunk/BNC/bncapp.h
===================================================================
--- trunk/BNC/bncapp.h	(revision 973)
+++ trunk/BNC/bncapp.h	(revision 974)
@@ -46,5 +46,5 @@
     void slotNewGPSEph(gpsephemeris* gpseph);
     void slotNewGlonassEph(glonassephemeris* glonasseph);
-    void slotNewCorrLine(QString line, QString staID);
+    void slotNewCorrLine(QString line, QString staID, long coTime);
     void slotQuit();
     
