Index: trunk/BNS/bns.cpp
===================================================================
--- trunk/BNS/bns.cpp	(revision 827)
+++ trunk/BNS/bns.cpp	(revision 828)
@@ -28,17 +28,26 @@
 
   this->setTerminationEnabled(true);
-
-  _bnseph    = 0; 
-  _outSocket = 0;
-  _clkSocket = 0;
+ 
+  // Thread that handles broadcast ephemeris
+  // ---------------------------------------
+  _bnseph = new t_bnseph(parent);
+
+  connect(_bnseph, SIGNAL(newEph(gpsEph*)), this, SLOT(slotNewEph(gpsEph*)));
+  connect(_bnseph, SIGNAL(newMessage(QByteArray)),
+          this, SLOT(slotMessage(const QByteArray)));
+  connect(_bnseph, SIGNAL(error(QByteArray)),
+          this, SLOT(slotError(const QByteArray)));
 
   // Server listening for rtnet results
   // ----------------------------------
   QSettings settings;
+  _clkSocket = 0;
   _clkServer = new QTcpServer;
   _clkServer->listen(QHostAddress::Any, settings.value("clkPort").toInt());
-
-  connect(_clkServer, SIGNAL(newConnection()),
-          this, SLOT(slotNewConnection()), Qt::DirectConnection);
+  connect(_clkServer, SIGNAL(newConnection()),this, SLOT(slotNewConnection()));
+
+  // Socket and file for outputting the results
+  // -------------------------------------------
+  _outSocket = 0;
 
   QString outFileName = settings.value("outFile").toString();
@@ -158,8 +167,4 @@
     delete _outSocket;
     _outSocket = 0;
-    emit(slotMessage("bns::openCaster socket deleted"));
-  }
-  else {
-    emit(slotMessage("bns::openCaster socket OK"));
   }
 }
@@ -202,16 +207,7 @@
   slotMessage("============ Start BNS ============");
 
-  // Thread that handles broadcast ephemeris
-  // ---------------------------------------
-  _bnseph = new t_bnseph(parent());
+  // Start Thread that retrieves broadcast Ephemeris
+  // -----------------------------------------------
   _bnseph->start();
-
-  connect(_bnseph, SIGNAL(newEph(gpsEph*)), this, SLOT(slotNewEph(gpsEph*)));
-
-  connect(_bnseph, SIGNAL(newMessage(QByteArray)),
-          this, SLOT(slotMessage(const QByteArray)));
-
-  connect(_bnseph, SIGNAL(error(QByteArray)),
-          this, SLOT(slotError(const QByteArray)));
 
   // Endless loop
