Index: /trunk/AddOn/TAcq/ckshrink.pic
===================================================================
--- /trunk/AddOn/TAcq/ckshrink.pic	(revision 3907)
+++ /trunk/AddOn/TAcq/ckshrink.pic	(revision 3907)
@@ -0,0 +1,73 @@
+
+# Script pour lire un fichier FITS avec les donnees FITS FFT_SHRINK et faire des plots de 
+# controle
+#  Appel : ckshrink.pic Directory NumeroFITS 
+delobjs *
+set DIR $1
+set OSIG signal$2
+set file $DIR/$OSIG.fits
+echo '----> ckshrink: Opening file ' $file
+readfits $file
+
+listobjs 
+newh2d C1ri -128.5 128.5 257 -128.5 128.5 257
+newh2d C2ri -128.5 128.5 257 -128.5 128.5 257
+newh1d C1exp -128.5 128.5 257
+newh1d C2exp -128.5 128.5 257
+newh1d C1val -128.5 128.5 257
+newh1d C2val -128.5 128.5 257
+
+newvec specC1 1024 
+newvec specC2 1024 
+
+rename $OSIG sigdum
+
+c++exec \
+  int C1OFFSET=24;  \
+  int C2OFFSET=2072; \
+  cout << " ===== Signal Analysis ===== START " << C1OFFSET << " , " << C2OFFSET << endl; \
+  for(int j=0; j<sigdum.NRows(); j++)  \
+    for(int i=0; i<sigdum.NCols(); i++)  \
+      sigdum(j,i) = (sigdum(j,i)<127.5)?sigdum(j,i):sigdum(j,i)-256.; \
+  for(int j=0; j<sigdum.NRows(); j++) { \
+    C1exp.Add(sigdum(j,C1OFFSET+2046)); \
+    C2exp.Add(sigdum(j,C2OFFSET+2046)); \
+    for(int i=C1OFFSET; i<C1OFFSET+2042; i+=2) { \
+        specC1((i-C1OFFSET)/2) += sqrt(sigdum(j,i)*sigdum(j,i)+sigdum(j,i+1)*sigdum(j,i+1));  \
+        C1ri.Add(sigdum(j,i),sigdum(j,i+1));  \
+        C1val.Add(sigdum(j,i));  C1val.Add(sigdum(j,i+1));  \ 
+    }  \
+    for(int i=C2OFFSET; i<C2OFFSET+2042; i+=2) { \
+        specC2((i-C2OFFSET)/2) += sqrt(sigdum(j,i)*sigdum(j,i)+sigdum(j,i+1)*sigdum(j,i+1));  \
+        C2ri.Add(sigdum(j,i),sigdum(j,i+1));  \
+        C2val.Add(sigdum(j,i));  C2val.Add(sigdum(j,i+1));  \ 
+    }  \
+  }  \
+  specC1 /= (double)sigdum.NRows();  \
+  specC2 /= (double)sigdum.NRows();  
+#
+# 	
+echo ' --- processing done, start plotting ... '
+
+mv sigdum $OSIG
+
+setaxesatt 'font=helvetica,bold,16 fixedfontsize minorticks'
+zone 3 2 
+disp C1exp 'font=helvetica,roman,14 blue' 
+disp C1val 'font=helvetica,roman,14 blue' 
+#disp C1ri 'font=helvetica,roman,14 blue'  
+plot2d C1ri x y val>0 "notit nsta blue"
+disp C2exp 'font=helvetica,roman,14 red' 
+disp C2val 'font=helvetica,roman,14 red' 
+#disp C2ri 'font=helvetica,roman,14 red' 
+plot2d C2ri x y val>0 "notit nsta red"
+
+newwin 
+zone 1 2 
+plot2d specC1 n*250/4096+125 val 1 'blue cpts font=helvetica,roman,14 nsta notit'
+settitle 'Spec Voie 1 ' ' ' ' blue font=helvetica,bold,16 '
+plot2d specC2 n*250/4096+125 val 1 'red cpts font=helvetica,roman,14 nsta notit'
+settitle 'Spec Voie 2 ' ' ' ' red font=helvetica,bold,16 '
+
+
+
Index: /trunk/AddOn/TAcq/racqueth.cc
===================================================================
--- /trunk/AddOn/TAcq/racqueth.cc	(revision 3906)
+++ /trunk/AddOn/TAcq/racqueth.cc	(revision 3907)
@@ -59,6 +59,10 @@
       sok.SendAll(msg,BRTCPMSGLEN);
       sok.ReceiveAll(msg,BRTCPMSGLEN);
-      if (strncmp(msg,"BAORadio-EthernetReader-OK",26)!=0) 
+      if (strncmp(msg,"BAORadio-EthernetReader-OK",26)!=0) {
+        msg[BRTCPMSGLEN-1]='\0';
+        cout << "PCIEToEthernet:ERROR/ bad Init_Acknowledge message from EthernetReader : \n  " << msg << endl;
+        usleep(10000);
 	throw SocketException("PCIEToEthernet:ERROR/  Connection to EthernetReader not established ");
+      }
       cout << " PCIEToEthernet: Ethernet connection established for DMA/fiber" << i << " with " << destname_[j] << endl;
       vskt.push_back(sok);
@@ -406,6 +410,8 @@
     for(int ii=0; ii<BRTCPMSGLEN; ii++) msg[ii]='\0';
     sok.ReceiveAll(msg,BRTCPMSGLEN);
-    if (strncmp(msg,"BAORadio-PCIEToEthernet",23)!=0) 
+    if (strncmp(msg,"BAORadio-PCIEToEthernet",23)!=0) {
+      cout << " EthernetReader:ERROR, bad init message from PCIEToEthernet client -> throw SocketException" << endl;
       throw SocketException("EthernetReader:ERROR/  Bad message from PCIEToEthernet client !");
+    }
     int ia,ib,ic,id,ie;
     sscanf(msg+25,"%d %d %d %d %d",&ia,&ib,&ic,&id,&ie);
@@ -414,4 +420,7 @@
       strcpy(msg,"BAORadio-EthernetReader-BAD MMgrNbPaquet/MMgrPaquetSize()");
       sok.SendAll(msg,BRTCPMSGLEN);
+      cout << " EthernetReader:ERROR, Bad client.MMgrNbPaquet/PaquetSize NbPaq=" << ia << " PaqSz=" << ib 
+	   << " Reader_PaqSz=" << memgr_.PaqSize() << endl;
+      usleep(10000);
       throw SocketException("EthernetReader:ERROR/  Bad MMgrNbPaquet/MMgrPaquetSize() from PCIEToEthernet client !");
     }
Index: /trunk/AddOn/TAcq/swrapsock.cc
===================================================================
--- /trunk/AddOn/TAcq/swrapsock.cc	(revision 3906)
+++ /trunk/AddOn/TAcq/swrapsock.cc	(revision 3907)
@@ -166,9 +166,30 @@
   : Socket() 
 {
+  Initialize(NULL, port, nconmax);
+}
+
+/* --Methode-- */
+ServerSocket::ServerSocket(const char* inadr, int port, int nconmax)
+  : Socket() 
+{
+  Initialize(inadr, port, nconmax);
+}
+
+/* --Methode-- */
+ServerSocket::ServerSocket(string const& inadr, int port, int nconmax)
+  : Socket() 
+{
+  Initialize(inadr.c_str(), port, nconmax);
+}
+
+
+/* --Methode-- */
+void ServerSocket::Initialize(const char* str_inadr, int port, int nconmax)
+{
   int s,rc;
   s = socket(AF_INET, SOCK_STREAM, 0);
   if (s < 0) { 
-    cout << "ServerSocket() Pb socket() ErrNo=" <<  errno << endl;  
-    throw SocketException("ServerSocket() Pb socket()");
+    cout << "ServerSocket::Initialize()  Pb socketErrNo=" <<  errno << endl;  
+    throw SocketException("ServerSocket::Initialize() Pb socket()");
     }
   skt = s;
@@ -180,11 +201,16 @@
   ipskt.sin_family = AF_INET;
   ipskt.sin_port = htons(port);
-  ipskt.sin_addr.s_addr = INADDR_ANY;
+  if (str_inadr==NULL) {   // pas d'adresse IP specifie 
+    ipskt.sin_addr.s_addr = INADDR_ANY;
+  }
+  else {  // adresse IP specifie sous la forme uuu.xxx.yyy.zzz.
+    ipskt.sin_addr.s_addr = inet_addr(str_inadr);
+  }
   /* Je fais un cast explicit de sockaddr_in * (Internet) en sockaddr *   */
   rc = bind(skt, (struct sockaddr *)(&ipskt), sizeof(ipskt));
   if (rc < 0) {
     Close();
-    cout << "ServerSocket() Pb bind() ErrNo=" <<  errno << endl;  
-    throw SocketException("ServerSocket() Pb bind()");
+    cout << "ServerSocket::Initialize() Pb bind() ErrNo=" <<  errno << endl;  
+    throw SocketException("ServerSocket::Initialize() Pb bind()");
   }
 }
Index: /trunk/AddOn/TAcq/swrapsock.h
===================================================================
--- /trunk/AddOn/TAcq/swrapsock.h	(revision 3906)
+++ /trunk/AddOn/TAcq/swrapsock.h	(revision 3907)
@@ -88,8 +88,12 @@
 public :
   ServerSocket(int port, int nconmax);
+  ServerSocket(const char* inadr, int port, int nconmax);
+  ServerSocket(string const& inadr, int port, int nconmax);
   Socket WaitClientConnection();
   virtual int Close();  // redefinition de la methode de Socket::Close()
 
 protected:
+  void Initialize(const char* inadr, int port, int nconmax);
+
   int portid;
   struct sockaddr_in  ipskt;
Index: /trunk/AddOn/TAcq/tsok.cc
===================================================================
--- /trunk/AddOn/TAcq/tsok.cc	(revision 3906)
+++ /trunk/AddOn/TAcq/tsok.cc	(revision 3907)
@@ -18,5 +18,5 @@
 
 void burawtst(); 
-int serverside(); 
+int serverside(const char* adr=NULL); 
 int clientside(string& servname, string& msg, string& args);
 
@@ -31,8 +31,8 @@
   if (narg < 2) {
     cout << " Erreur Argument / tsok.cc : Socket class tests \n" 
-         << "    Usage : tsok S/C [servername=localhost] [OPEMsg=Hello] [NLoop,SizeX,SizeY] [RIOS_NPaq=16]\n" 
+         << "    Usage : tsok S/s/C [servername=localhost] [OPEMsg=Hello] [NLoop,SizeX,SizeY] [RIOS_NPaq=16]\n" 
          << "    Ex: tsok S   or  tsok C serverName or \n" 
          << "        tsok C serverName PPFSOCKET  5,1000,800 \n" 
-         << "   S : run tsok as server side \n" 
+         << "   S/s : run tsok as server side, (S: specify ServerSocket In_Adress)  \n" 
          << "   C : run tsok as client side \n"
          << "   OPEMsg : Operation select on client side (=XXX , PPFSOCKET , STOP)   \n"
@@ -42,5 +42,7 @@
   }  
   bool fgserv = false;
-  if (*arg[1] == 'S')  fgserv = true;
+  bool fginadr = false;
+  if (*arg[1] == 's')  fgserv = true;
+  else if (*arg[1] == 'S') { fgserv=true;  fginadr=true; }
   string servname = "localhost";
   if (narg > 2)  servname = arg[2];
@@ -55,5 +57,8 @@
     SophyaInit();  
     InitTim(); 
-    if (fgserv) rc=serverside();
+    if (fgserv) { 
+      if (fginadr) rc=serverside(servname.c_str());
+      else rc=serverside();
+    }
     else if (*arg[1] == 'C') rc=clientside(servname, opemsg, oargs);
     else burawtst();
@@ -76,10 +81,11 @@
 
 /* --Fonction-- */
-int serverside()
+int serverside(const char* adr)
 {
   int rc = 66;
   cout << " ======== tsok.cc / ServerSide ============ " << endl;
-  cout << " Creating server socket ... , PortId= " << PORTID << endl;
-  ServerSocket srv(PORTID, 1);
+  if (adr !=NULL)  cout << " Creating server socket InAddress=" << adr << ", PortId= " << PORTID << endl;
+  else cout << " Creating server socket ... , PortId= " << PORTID << endl;
+  ServerSocket srv(adr, PORTID, 1);
   bool fgstop = false;
   int nc = 0;
@@ -144,5 +150,5 @@
     }  // fin while(! fgbye) 
     cout << "ServerSide: Closing current socket ..." << endl;
-    skt.Close();
+    skt.Close(); 
     rc = 0;
   }  // fin while(!fgstop)
