Index: trunk/MagicSoft/Cosy/tcpip/MCeCoCom.h
===================================================================
--- trunk/MagicSoft/Cosy/tcpip/MCeCoCom.h	(revision 8856)
+++ trunk/MagicSoft/Cosy/tcpip/MCeCoCom.h	(revision 8862)
@@ -48,6 +48,6 @@
 
 public:
-    MCeCoCom(MLog *out)
-        : MTcpIpIO("ceco", 7304, 7404), fOut(out), fStatus(0), fComStat(kNoCmdReceived),
+    MCeCoCom(const char *addr, MLog *out)
+        : MTcpIpIO(addr, 7304, 7404), fOut(out), fStatus(0), fComStat(kNoCmdReceived),
         fHumidity(0), fTemperature(0), fWindSpeed(0), fSolarRadiation(-1),
         fAlarmCounter(0)
Index: trunk/MagicSoft/Cosy/tcpip/MDriveCom.h
===================================================================
--- trunk/MagicSoft/Cosy/tcpip/MDriveCom.h	(revision 8856)
+++ trunk/MagicSoft/Cosy/tcpip/MDriveCom.h	(revision 8862)
@@ -41,5 +41,5 @@
     };
 
-    MDriveCom(MsgQueue *q, MLog *out) : MCeCoCom(out), fQueue(q) {}
+    MDriveCom(MsgQueue *q, const char *addr, MLog *out) : MCeCoCom(addr, out), fQueue(q) {}
 
     bool SendReport(UInt_t stat, RaDec rd, ZdAz so, ZdAz is, ZdAz er);
Index: trunk/MagicSoft/Cosy/tcpip/MTcpIpIO.cc
===================================================================
--- trunk/MagicSoft/Cosy/tcpip/MTcpIpIO.cc	(revision 8856)
+++ trunk/MagicSoft/Cosy/tcpip/MTcpIpIO.cc	(revision 8862)
@@ -8,4 +8,6 @@
 #include "MLog.h"
 #include "MLogManip.h"
+
+#include "MString.h"
 
 #undef DEBUG
@@ -55,9 +57,26 @@
 }
 
+TString MTcpIpO::GetSocketAddress(const TSocket &s)
+{
+    if (!s.IsValid())
+        return "n/a";
+
+    const TInetAddress &a = s.GetInetAddress();
+    if (!a.IsValid())
+        return "undefined";
+
+    return MString::Format("%s:%d", a.GetHostAddress(), a.GetPort());
+}
+
+TString MTcpIpO::GetSocketAddress() const
+{
+    return GetSocketAddress(*fTxSocket);
+}
+
 bool MTcpIpO::SendFrame(TSocket &tx, const char *msg, int len)
 {
     if (!tx.IsValid())
     {
-        //cout << "*!* Transmit socket invalid!" << endl;
+        //gLog << warn << "WARNING - No transmission to " << GetSocketAddress(tx) << " possible." << endl;
         return false;
     }
@@ -66,5 +85,5 @@
     if (l<0)
     {
-        cout << "ERROR - Sending Message" << endl;
+        gLog << err << "ERROR - Sending TCP/IP frame to " << GetSocketAddress(tx) << endl;
         return false;
     }
@@ -72,5 +91,5 @@
     if (l!=len)
     {
-        cout << "Send wrong number (" << l << ") of Bytes." << endl;
+        gLog << err << "ERROR - Sent wrong number (" << l << ") of bytes to " << GetSocketAddress(tx) << endl;
         return false;
     }
@@ -86,23 +105,24 @@
 {
     //    R__LOCKGUARD2(myMutex);
-
+#ifdef DEBUG
     cout << "Connecting to " << addr << ":" << port << endl;
+#endif
 
     // FIXME: Set tx-socket to nonblocking?
     TSocket tx(addr, port);
-    //    return SendFrame(tx, msg, len);
-
+    return SendFrame(tx, msg, len);
+/*
     if (!tx.IsValid())
     {
-        //cout << "*!* Transmit socket invalid!" << endl;
-        return false;
-    }
-
-    cout << "Sending to " << addr << ":" << port << endl;
+        gLog << warn << "WARNING - No transmission to " << addr << ":" << port << " possible." << endl;
+        return false;
+    }
+
+    gLog << dbg << "Sending to " << addr << ":" << port << endl;
 
     const Int_t l = tx.SendRaw(msg, len, kDontBlock);
     if (l<0)
     {
-        cout << "ERROR - Sending Message" << endl;
+        gLog << err << "ERROR - Sending TCP/IP frame to " << addr << ":" << port << endl;
         return false;
     }
@@ -110,5 +130,5 @@
     if (l!=len)
     {
-        cout << "Send wrong number (" << l << ") of Bytes." << endl;
+        gLog << err << "ERROR - Sent wrong number (" << l << ") of bytes to " << addr << ":" << port << endl;
         return false;
     }
@@ -119,4 +139,5 @@
 
     return true;
+    */
 }
 
@@ -188,4 +209,10 @@
     gLog << inf << "- Starting receiver on port " << fPortRx << "..." << endl;
 
+//    if (fPortRx==7404)
+//    {
+//        gLog << err << "CeCo communication skipped." << endl;
+//        return 0;
+//    }
+
     TServerSocket *fServSock=NULL;
     TSocket       *fRxSocket=NULL;
@@ -197,12 +224,12 @@
         if (!fServSock->IsValid())
         {
-            cout << "ServerSocket on port " << fPortRx << " invalid: ";
+            gLog << err << "ServerSocket on port " << fPortRx << " invalid: ";
             switch (fServSock->GetErrorCode())
             {
-            case  0: cout << "No error." << endl; break;
-            case -1: cout << "low level socket() call failed." << endl; break;
-            case -2: cout << "low level bind() call failed." << endl; break;
-            case -3: cout << "low level listen() call failed." << endl; break;
-            default: cout << "Unknown." << endl; break;
+            case  0: gLog << "No error." << endl; break;
+            case -1: gLog << "low level socket() call failed." << endl; break;
+            case -2: gLog << "low level bind() call failed." << endl; break;
+            case -3: gLog << "low level listen() call failed." << endl; break;
+            default: gLog << "Unknown." << endl; break;
             }
             delete fServSock;
@@ -214,5 +241,5 @@
         fServSock->SetOption(kNoBlock, 1);
 
-        cout << "Waiting for connection on port " << fPortRx << "..." << endl;
+        gLog << all << "Waiting for connection on port " << fPortRx << "..." << endl;
 //        while (!HasStopFlag() && (Long_t)fRxSocket<=0)
         while (!IsThreadCanceled() && (Long_t)fRxSocket<=0)
@@ -247,5 +274,5 @@
         }
 
-        cout << "Connection established on port " << fPortRx << "." << endl;
+        gLog << all << "Connection established on port " << fPortRx << "." << endl;
 
         fRxSocket->SetOption(kNoBlock, 1);
Index: trunk/MagicSoft/Cosy/tcpip/MTcpIpIO.h
===================================================================
--- trunk/MagicSoft/Cosy/tcpip/MTcpIpIO.h	(revision 8856)
+++ trunk/MagicSoft/Cosy/tcpip/MTcpIpIO.h	(revision 8862)
@@ -40,8 +40,10 @@
     ~MTcpIpO();
 
-    static bool SendFrame(TSocket &tx, const char *msg, int len);
-    static bool SendFrame(const char *addr, int port, const char *msg, int len);
+    static TString GetSocketAddress(const TSocket &s);
+    static bool    SendFrame(TSocket &tx, const char *msg, int len);
+    static bool    SendFrame(const char *addr, int port, const char *msg, int len);
 
-    bool Send(const char *msg, int len);
+    TString GetSocketAddress() const;
+    bool    Send(const char *msg, int len);
 };
 
