Index: trunk/AddOn/TAcq/racqueth.cc
===================================================================
--- trunk/AddOn/TAcq/racqueth.cc	(revision 3762)
+++ trunk/AddOn/TAcq/racqueth.cc	(revision 3763)
@@ -53,6 +53,6 @@
       sprintf(msg,"BAORadio-PCIEToEthernet  %d %d %d %d %d", par_.MMgrNbPaquet(), par_.MMgrPaquetSize(), dmasz, 0,i);
       //           123456789012345678901234567890
-      sok.Send(msg,BRTCPMSGLEN);
-      sok.Receive(msg,BRTCPMSGLEN);
+      sok.SendAll(msg,BRTCPMSGLEN);
+      sok.ReceiveAll(msg,BRTCPMSGLEN);
       if (strncmp(msg,"BAORadio-EthernetReader-OK",26)!=0) 
 	throw SocketException("PCIEToEthernet:ERROR/  Connection to EthernetReader not established ");
@@ -140,5 +140,5 @@
     for(size_t j=0; j<vskt.size(); j++) {
       for(int ii=0; ii<BRTCPMSGLEN; ii++) msg[ii]='\0';
-      vskt[j].Receive(msg,BRTCPMSGLEN);
+      vskt[j].ReceiveAll(msg,BRTCPMSGLEN);
       if (strncmp(msg,"BAORadio-EthernetReader-Ready-GO",32)!=0) {
 	msg[BRTCPMSGLEN-1]='\0';
@@ -316,5 +316,5 @@
 size_t PCIEToEthernet::SendToTargets(int fib, Byte* data, size_t len)
 {
-  //  cout << " SendToTargets/DBG" << cnt_prt << " len=" << len << " data=" << hex << (unsigned long)data << dec << endl; cnt_prt++; 
+  //DBG    cout << " SendToTargets/DBG" << cnt_prt << " len=" << len << " data=" << hex << (unsigned long)data << dec << endl; cnt_prt++; 
   vector<ClientSocket>& vskt = vvec_skt_[fib];
   size_t rc=0;
@@ -323,9 +323,9 @@
     sprintf(msg,"PCIEToEthernet-SendCnt %d",vec_cntpaq_[fib]);
     for(size_t j=0; j<vskt.size(); j++) {
-      vskt[j].Send(msg, BRTCPMSGLEN2);
+      vskt[j].SendAll(msg, BRTCPMSGLEN2);
     }
     if (vec_cntpaq_[fib]>0) {
       for(size_t j=0; j<vskt.size(); j++) {
-	vskt[j].Receive(msg, BRTCPMSGLEN2);
+	vskt[j].ReceiveAll(msg, BRTCPMSGLEN2);
 	msg[BRTCPMSGLEN2-1]='\0';
 	if (strncmp(msg,"EthernetReader-RecvCnt",22) != 0)
@@ -334,7 +334,14 @@
     }
   }
+  for(size_t j=0; j<vskt.size(); j++) {
+    rc += vskt[j].SendAll((const char *)data, len);
+    totrdsnd_ += eths_bsz_;
+  }
+  vec_cntpaq_[fib]++;
+  return rc;
+  /*  
   if (eths_bsz_<16) {
     for(size_t j=0; j<vskt.size(); j++) {
-      rc += vskt[j].Send((const char *)data, len);
+      rc += vskt[j].SendAll((const char *)data, len);
       totrdsnd_ += eths_bsz_;
     }
@@ -348,5 +355,5 @@
     for(size_t i=0; i<nblk; i++) {
       for(size_t j=0; j<vskt.size(); j++) {
-	rc += vskt[j].Send((const char *)data+off, eths_bsz_);
+	rc += vskt[j].SendAll((const char *)data+off, eths_bsz_);
 	totrdsnd_ += eths_bsz_;
       }
@@ -356,5 +363,5 @@
   if (fblk>0) {
     for(size_t j=0; j<vskt.size(); j++) {
-      rc += vskt[j].Send((const char *)data+off, fblk);
+      rc += vskt[j].SendAll((const char *)data+off, fblk);
       totrdsnd_ += fblk;
     }
@@ -362,4 +369,5 @@
   vec_cntpaq_[fib]++;
   return rc;
+  */
 }
 //------------------------------------------------------------------
@@ -397,5 +405,5 @@
     Socket sok=srv.WaitClientConnection();
     for(int ii=0; ii<BRTCPMSGLEN; ii++) msg[ii]='\0';
-    sok.Receive(msg,BRTCPMSGLEN);
+    sok.ReceiveAll(msg,BRTCPMSGLEN);
     if (strncmp(msg,"BAORadio-PCIEToEthernet",23)!=0) 
       throw SocketException("EthernetReader:ERROR/  Bad message from PCIEToEthernet client !");
@@ -404,10 +412,10 @@
     if (((uint_4)ia!=par_.MMgrNbPaquet()) || ((uint_4)ib!=par_.MMgrPaquetSize())) {
       strcpy(msg,"BAORadio-EthernetReader-BAD MMgrNbPaquet/MMgrPaquetSize()");
-      sok.Send(msg,BRTCPMSGLEN);
+      sok.SendAll(msg,BRTCPMSGLEN);
       throw SocketException("EthernetReader:ERROR/  Bad MMgrNbPaquet/MMgrPaquetSize() from PCIEToEthernet client !");
     }
     for(int ii=0; ii<BRTCPMSGLEN; ii++) msg[ii]='\0';
     strcpy(msg,"BAORadio-EthernetReader-OK");
-    sok.Send(msg,BRTCPMSGLEN);
+    sok.SendAll(msg,BRTCPMSGLEN);
     vsok_.push_back(sok);
     cout << " EthernetReader/Info connection/link" << fib << " established." << endl; 
@@ -437,5 +445,5 @@
     for(size_t fib=0; fib<(size_t)memgr_.NbFibres(); fib++) {
       cout << " EthernetReader/Debug - Sending GO message to sender " << fib << endl;
-      vsok_[fib].Send(msg,BRTCPMSGLEN);
+      vsok_[fib].SendAll(msg,BRTCPMSGLEN);
     }
     Byte* nextpaq=NULL;
@@ -550,11 +558,14 @@
     char msg[BRTCPMSGLEN2];
     msg[0]='\0';
-    vsok_[fib].Receive(msg, BRTCPMSGLEN2);
+    vsok_[fib].ReceiveAll(msg, BRTCPMSGLEN2);
     if (strncmp(msg,"PCIEToEthernet-SendCnt",22) != 0) 
       cout << " EthernetReader::ReceiveFromSocket/ BAD HandShake message : " << msg << endl;
   }  
-
+  rc += vsok_[fib].ReceiveAll(data, len);
+  vec_cntpaq_[fib]++;
+
+  /*    
   if (ethr_bsz_<16) {
-    rc += vsok_[fib].Receive(data, len);
+    rc += vsok_[fib].ReceiveAll(data, len);
   }
   else {
@@ -564,18 +575,19 @@
     if (nblk>0) {
       for(size_t i=0; i<nblk; i++)  {
-	rc += vsok_[fib].Receive(data+off, ethr_bsz_);
+	rc += vsok_[fib].ReceiveAll(data+off, ethr_bsz_);
 	off += ethr_bsz_;  
       }
     }
     if (fblk>0) {
-      rc += vsok_[fib].Receive(data+off, fblk);
+      rc += vsok_[fib].ReceiveAll(data+off, fblk);
     } 
   }
   vec_cntpaq_[fib]++;
+    */
 
   if (vec_cntpaq_[fib]%par_.MMgrNbPaquet() == 0) {
     char msg[BRTCPMSGLEN2];
     sprintf(msg,"EthernetReader-RecvCnt %d",vec_cntpaq_[fib]);
-    vsok_[fib].Send(msg, BRTCPMSGLEN2);
+    vsok_[fib].SendAll(msg, BRTCPMSGLEN2);
   }  
   return rc;
