Index: trunk/BNS/bns.cpp
===================================================================
--- trunk/BNS/bns.cpp	(revision 769)
+++ trunk/BNS/bns.cpp	(revision 770)
@@ -37,4 +37,6 @@
   _clkServer = 0;
   _clkSocket = 0;
+
+  _outSocket = 0;
 }
 
@@ -44,4 +46,5 @@
   deleteBnsEph();
   delete _clkServer;
+  delete _outSocket;
 }
 
@@ -78,4 +81,32 @@
 }
 
+// Start the Communication with NTRIP Caster
+////////////////////////////////////////////////////////////////////////////
+void t_bns::openCaster() {
+  
+  QSettings settings;
+  QString host = settings.value("outHost").toString();
+  int     port = settings.value("outPort").toInt();
+
+  _outSocket = new QTcpSocket();
+  _outSocket->connectToHost(host, port);
+
+  QString mountpoint = settings.value("mountpoint").toString();
+  QString password   = settings.value("password").toString();
+
+  QByteArray msg = "SOURCE " + password.toAscii() + " /" + 
+                   mountpoint.toAscii() + "\r\n" +
+                   "Source-Agent: NTRIP BNS/1.0\r\n\r\n";
+
+  _outSocket->write(msg);
+
+  QByteArray ans = _outSocket->readLine();
+
+  if (ans.indexOf("OK") == -1) {
+    delete _outSocket;
+    _outSocket = 0;
+  }
+}
+
 // Start 
 ////////////////////////////////////////////////////////////////////////////
@@ -83,13 +114,22 @@
 
   slotMessage("============ Start BNS ============");
+
+  // Start Thread that retrieves broadcast Ephemeris
+  // -----------------------------------------------
   _bnseph->start();
 
+  // Open the connection to NTRIP Caster
+  // -----------------------------------
+  openCaster();
+
+  // Start listening for rtnet results
+  // ---------------------------------
   QSettings settings;
-  int port = settings.value("clkPort").toInt();
+  _clkServer = new QTcpServer;
+  _clkServer->listen(QHostAddress::Any, settings.value("clkPort").toInt());
+  connect(_clkServer, SIGNAL(newConnection()),this, SLOT(slotNewConnection()));
 
-  _clkServer = new QTcpServer;
-  _clkServer->listen(QHostAddress::Any, port);
-  connect(_clkServer, SIGNAL(newConnection()), this, SLOT(slotNewConnection()));
-
+  // Endless loop
+  // ------------
   while (true) {
     if (_clkSocket) {
Index: trunk/BNS/bns.h
===================================================================
--- trunk/BNS/bns.h	(revision 769)
+++ trunk/BNS/bns.h	(revision 770)
@@ -25,6 +25,8 @@
  private:
   void deleteBnsEph();
+  void openCaster();
   QTcpServer* _clkServer;
   QTcpSocket* _clkSocket;
+  QTcpSocket* _outSocket;
   t_bnseph*   _bnseph;
   QMutex      _mutex;
