Index: trunk/MagicSoft/Cosy/candrv/canopen.cc
===================================================================
--- trunk/MagicSoft/Cosy/candrv/canopen.cc	(revision 8863)
+++ trunk/MagicSoft/Cosy/candrv/canopen.cc	(revision 8864)
@@ -78,4 +78,9 @@
     if (fInterface)
         fInterface->Stop();
+}
+
+bool CanOpen::HasError() const
+{
+    return fInterface ? !fInterface->HasConnection() : kFALSE;
 }
 
Index: trunk/MagicSoft/Cosy/candrv/canopen.h
===================================================================
--- trunk/MagicSoft/Cosy/candrv/canopen.h	(revision 8863)
+++ trunk/MagicSoft/Cosy/candrv/canopen.h	(revision 8864)
@@ -78,4 +78,6 @@
     virtual void Start();           // Start CanOpen communication
     virtual void Stop();            // Stop  CanOpen communcation
+
+    virtual bool HasError() const;
 
 private:
Index: trunk/MagicSoft/Cosy/candrv/ethernet.cc
===================================================================
--- trunk/MagicSoft/Cosy/candrv/ethernet.cc	(revision 8863)
+++ trunk/MagicSoft/Cosy/candrv/ethernet.cc	(revision 8864)
@@ -74,5 +74,5 @@
 // --------------------------------------------------------------------------
 //
-void Ethernet::ReadSocket(TSocket &rx)
+Bool_t Ethernet::ReadSocket(TSocket &rx)
 {
     Int_t pos = -1;
@@ -87,11 +87,7 @@
     while (!IsThreadCanceled())
     {
-        //TThread::CancelPoint();
-
         unsigned char c;
         const Int_t len = rx.RecvRaw(&c, 1);
 
-        //TThread::CancelPoint();
-
         // No data received (non-blocking mode)
         if (len<0)
@@ -101,11 +97,7 @@
         }
 
-        // Data received with zero length!
+        // Data received with zero length! (Connection lost)
         if (len==0)
-        {
-            gLog << warn << "WARNING - Connection lost (received 0bytes) to " << address << endl;
-            //break; // This break is for TEST PURPOSE FIXME!!!
-            continue;
-        }
+            return kFALSE;
 
         // Data received
@@ -113,5 +105,5 @@
         {
             gLog << err << "Data received from " << address << " is more than one byte!" << endl;
-            break;
+            continue;
         }
 
@@ -121,5 +113,5 @@
             {
                 cout << "Data received from " << address << " too long (> " << MSGLEN << ")" << endl;
-                break;
+                continue;
             }
 
@@ -147,7 +139,88 @@
         // String completed
         HandleMessage(msg);
+
+        return kTRUE;
     }
-}
-
+
+    return kTRUE;
+}
+
+/*
+void Ethernet::ReadSocket(TSocket &rx)
+{
+    Int_t pos = -1;
+
+    Message msg;
+    msg.cmd = M_BCAN_RX_ind;
+    msg.data[0] = 0;
+    msg.data[1] = 0;
+
+    const TString address = MTcpIpO::GetSocketAddress(rx);
+
+    while (!IsThreadCanceled())
+    {
+        //TThread::CancelPoint();
+
+        unsigned char c;
+        const Int_t len = rx.RecvRaw(&c, 1);
+
+        //TThread::CancelPoint();
+
+        // No data received (non-blocking mode)
+        if (len<0)
+        {
+            usleep(1);
+            continue;
+        }
+
+        // Data received with zero length!
+        if (len==0)
+        {
+            gLog << warn << "WARNING - Connection lost (received 0bytes) to " << address << endl;
+            //break; // This break is for TEST PURPOSE FIXME!!!
+            return;
+        }
+
+        // Data received
+        if (len>1)
+        {
+            gLog << err << "Data received from " << address << " is more than one byte!" << endl;
+            continue;
+        }
+
+        if (pos<0)
+        {
+            if (c>=MSGLEN)
+            {
+                cout << "Data received from " << address << " too long (> " << MSGLEN << ")" << endl;
+                continue;
+            }
+
+            msg.len = c;
+            pos = 2;
+            continue;
+        }
+
+        //            if (pos==2 && c==0x0a)
+        //                continue;
+
+        msg.data[pos++] = c;
+        if (pos-2<msg.len)
+            continue;
+
+#ifdef DEBUG
+        cout << "*** RcvdCanFrame len=" << dec << msg.len << ": ";
+        for (int i=0; i<msg.len; i++)
+            cout << "0x" << setfill('0') << setw(2) << hex << (int)((msg.data+2)[i]) << " ";
+        cout << dec << endl;
+#endif
+
+        pos = -1;
+
+        // String completed
+        HandleMessage(msg);
+    }
+}
+*/
 
 // --------------------------------------------------------------------------
@@ -174,4 +247,7 @@
 //   */
 //
+#ifdef DEBUG
+#include <TStopwatch.h>
+#endif
 void Ethernet::SendCanFrame(WORD_t cobid, BYTE_t m[8], BYTE_t rtr)
 {
@@ -203,5 +279,12 @@
 #endif
 
+#ifdef DEBUG
+    TStopwatch st;
+    st.Start();
+#endif
     MTcpIpO::SendFrame(fTxAddress, fTxPort, (char*)(msg.data+1), msg.len-1);
+#ifdef DEBUG
+    st.Print();
+#endif
     //Send((char*)(msg.data+1), msg.len-1);
 
Index: trunk/MagicSoft/Cosy/candrv/ethernet.h
===================================================================
--- trunk/MagicSoft/Cosy/candrv/ethernet.h	(revision 8863)
+++ trunk/MagicSoft/Cosy/candrv/ethernet.h	(revision 8864)
@@ -17,9 +17,11 @@
 
     // Send interface based on MTcpIpI
-    void ReadSocket(TSocket &rx);
+    Bool_t ReadSocket(TSocket &rx);
 
     // Start/stop communication inherited from Interface
     void Start() { RunThread(); }
     void Stop()  { CancelThread(); }
+
+    Bool_t HasConnection() const { return IsConnectionEstablished(); }
 
 public:
Index: trunk/MagicSoft/Cosy/candrv/interface.h
===================================================================
--- trunk/MagicSoft/Cosy/candrv/interface.h	(revision 8863)
+++ trunk/MagicSoft/Cosy/candrv/interface.h	(revision 8864)
@@ -45,4 +45,6 @@
     virtual void EnableCobId(WORD_t cobid, int flag=TRUE) { }
 
+    virtual bool HasConnection() const { return true; }
+
     // Public interface
     void PrintMsg(const Message &m);
Index: trunk/MagicSoft/Cosy/candrv/network.cc
===================================================================
--- trunk/MagicSoft/Cosy/candrv/network.cc	(revision 8863)
+++ trunk/MagicSoft/Cosy/candrv/network.cc	(revision 8864)
@@ -314,4 +314,7 @@
             continue;
 
+        if (CanOpen::HasError())
+            fNodes[i]->SetZombie();
+
         if (!fNodes[i]->HasError())
             continue;
@@ -325,4 +328,7 @@
         //gLog << "' has error #" << fNodes[i]->GetError() << endl;
     }
+
+    if (CanOpen::HasError())
+        return true;
 
     return rc;
Index: trunk/MagicSoft/Cosy/candrv/nodedrv.h
===================================================================
--- trunk/MagicSoft/Cosy/candrv/nodedrv.h	(revision 8863)
+++ trunk/MagicSoft/Cosy/candrv/nodedrv.h	(revision 8864)
@@ -60,5 +60,5 @@
 
     int  GetError() const { return fError; }
-    bool HasError() const { return fError; }
+    bool HasError() const { return fError!=0; }
 
     bool IsZombieNode() const { return fIsZombie; }
