Index: /XMLIO_V2/dev/dev_rv/src/xmlio/buffer.cpp
===================================================================
--- /XMLIO_V2/dev/dev_rv/src/xmlio/buffer.cpp	(revision 197)
+++ /XMLIO_V2/dev/dev_rv/src/xmlio/buffer.cpp	(revision 198)
@@ -40,4 +40,5 @@
       {
          if (delIdata) delete [] this->idata;
+         else this->fillData('\0', this->getSize(), 0);
          //CMPIManager::FreeMem(idata);
       }
@@ -78,5 +79,7 @@
          std::copy(this->getData(position), this->getData(position + size), data);
       }
-
+      
+      //---------------------------------------------------------------
+      
       void CBuffer::setData(const char * data, StdSize size, StdSize position)
       {
@@ -248,4 +251,14 @@
       }
       
+      //---------------------------------------------------------------
+      
+      void CBuffer::fillData(char data, StdSize size, StdSize position)
+      {
+         if (this->size < (size + position))
+            ERROR("CBuffer::getData(data, size, position)",
+                   << " Buffer size <  size + position !");
+         std::fill_n(this->getData(position), size, data);
+      }
+      
       ///--------------------------------------------------------------
 
Index: /XMLIO_V2/dev/dev_rv/src/xmlio/buffer.hpp
===================================================================
--- /XMLIO_V2/dev/dev_rv/src/xmlio/buffer.hpp	(revision 197)
+++ /XMLIO_V2/dev/dev_rv/src/xmlio/buffer.hpp	(revision 198)
@@ -115,4 +115,5 @@
 
             void setData(const char * data, StdSize size, StdSize position);
+            void fillData(char data, StdSize size, StdSize position);
 
          private :
Index: /XMLIO_V2/dev/dev_rv/src/xmlio/buffer_impl.hpp
===================================================================
--- /XMLIO_V2/dev/dev_rv/src/xmlio/buffer_impl.hpp	(revision 197)
+++ /XMLIO_V2/dev/dev_rv/src/xmlio/buffer_impl.hpp	(revision 198)
@@ -27,10 +27,13 @@
       {
          if (this->size < (position + this->getRequestedSize(data)))
-            ERROR("CBuffer::getData<T>(data, size, position)",
+            ERROR("CBuffer::getData(data, position)",
                    << " Buffer size <  size + position !");
          CBufferData bufdata;
          this->getBufferData(bufdata, position);
          if (bufdata.type != this->getBufferDataType<T>())
-            ERROR("CBuffer::getData(data, position)", << " invalid type !");
+            ERROR("CBuffer::getData(data, position)", 
+                  << "[ BufferDataType Read : " << bufdata.type                 << ", "
+                  << ", BufferDataType T : "    << this->getBufferDataType<T>() << "] "
+                  << " invalid type !");
          if (bufdata.isArray != false)
             ERROR("CBuffer::getData(data, position)",
Index: /XMLIO_V2/dev/dev_rv/src/xmlio/buffer_list.cpp
===================================================================
--- /XMLIO_V2/dev/dev_rv/src/xmlio/buffer_list.cpp	(revision 197)
+++ /XMLIO_V2/dev/dev_rv/src/xmlio/buffer_list.cpp	(revision 198)
@@ -19,6 +19,6 @@
       bool CBufferList::hasRequests(void) const
       {
-         bool retvalue = true;
-         for (StdSize i = 0; i < this->nbbuffer; i++)
+         bool retvalue = SuperClass::operator[](0).hasRequest();
+         for (StdSize i = 1; i < this->nbbuffer; i++)
             retvalue = retvalue && SuperClass::operator[](i).hasRequest();
          return (retvalue);
@@ -36,5 +36,5 @@
                   if (SuperClass::operator[](i-1).isAvailable(size))
                   {
-                     std::cout << "b:" << i << std::endl;
+                     std::cout << "DonnÃ©es reÃ§ues de " << i << std::endl;
                      CMPIManager::ReceiveCircularBuffer
                         (com_client_server, i, SuperClass::operator[](i-1));
@@ -50,5 +50,14 @@
             }
          }
-         std::cout << "lol" << std::endl;
+         
+         static int u = 0;
+         std::cout << "Nouvelle requÃªte disponible " << u++ << std::endl;
+         /*if (u == 3046)
+            for (int i = 1; i < CMPIManager::GetCommSize(com_client_server); i++)
+            {
+               StdOStringStream oss; oss << "data/buffer"<<i<<".txt";
+               SuperClass::operator[](i-1).printToTextFile (oss.str());
+            }*/
+            
          return (true);
       }
@@ -57,5 +66,8 @@
       {
          for (StdSize i = 0; i < this->nbbuffer; i++)
+         {
+            std::cout << "RÃ©cupÃ©ration de la requÃªte " << (i+1) << std::endl;
             lbuffer.push_back(SuperClass::operator[](i).getNextRequest());
+         }
       }
 
Index: /XMLIO_V2/dev/dev_rv/src/xmlio/buffer_pair.cpp
===================================================================
--- /XMLIO_V2/dev/dev_rv/src/xmlio/buffer_pair.cpp	(revision 197)
+++ /XMLIO_V2/dev/dev_rv/src/xmlio/buffer_pair.cpp	(revision 198)
@@ -20,9 +20,12 @@
       bool CBufferPair::mustBeSent(void)
       {
-         if (((currentBuffer  ==  0) && (first.getUsedSize()  != 0) &&
-             ((second_request == -1) || CMPIManager::Test (second_request))) ||
-             ((currentBuffer  ==  1) && (second.getUsedSize() != 0) &&
-             ((first_request  == -1) || CMPIManager::Test (first_request))))
+         if ((currentBuffer  ==  0) && (first.getUsedSize()  != 0) &&
+            ((second_request == -1) || CMPIManager::Test (second_request)))
+             return (true);
+             
+         if ((currentBuffer  ==  1) && (second.getUsedSize() != 0) &&
+            ((first_request  == -1) || CMPIManager::Test (first_request)))
             return (true);
+            
          return (false);
       }
@@ -30,9 +33,18 @@
       //---------------------------------------------------------------
       
-      void CBufferPair::wait(void)
+      int CBufferPair::wait(void)
       {
          if (this->currentBuffer == 0)
-              CMPIManager::Wait(this->second_request);
-         else CMPIManager::Wait(this->first_request);
+         {
+            CMPIManager::Wait(this->second_request);
+            this->second_request = -1;
+            return (this->second_request);
+         }
+         else
+         {
+            CMPIManager::Wait(this->first_request);
+            this->first_request = -1;
+            return (this->first_request);
+         }
       }
       
@@ -45,12 +57,14 @@
             CMPIManager::SendLinearBuffer
                (this->com_client_server, 0, this->first, this->first_request);
-            this->currentBuffer = 1;
+            this->currentBuffer  =  1;
+            this->second_request = -1;
             this->second.clear();
          }
-         else
+         else  if(this->currentBuffer == 1)
          {
             CMPIManager::SendLinearBuffer
                (this->com_client_server, 0, this->second, this->second_request);
-            this->currentBuffer = 0;
+            this->currentBuffer =  0;
+            this->first_request = -1;
             this->first.clear();
          }
Index: /XMLIO_V2/dev/dev_rv/src/xmlio/buffer_pair.hpp
===================================================================
--- /XMLIO_V2/dev/dev_rv/src/xmlio/buffer_pair.hpp	(revision 197)
+++ /XMLIO_V2/dev/dev_rv/src/xmlio/buffer_pair.hpp	(revision 198)
@@ -38,5 +38,5 @@
             
             /// Traitements divers ///
-            void wait(void);
+            int wait(void);
             void sendCurrentBuffer(void); 
                         
@@ -66,4 +66,18 @@
                                           A1 * arg1, A2 * arg2, A3 * arg3, A4 * arg4)
       {
+         static int recurse = 0;
+         if (recurse > 1)
+         {
+            std::cout << "putain :" <<  recurse << "," << this->mustBeSent() 
+                      << "," << currentBuffer << "," << first.getUsedSize() << "," << second.getUsedSize();
+            if ((currentBuffer  ==  0) && (first.getUsedSize()  != 0) && (second_request != -1))
+               std::cout << "," << CMPIManager::Test (second_request);
+            if ((currentBuffer  ==  1) && (second.getUsedSize()  != 0) && (first_request != -1))
+               std::cout << "," << CMPIManager::Test (first_request);
+            std::cout << "," << second_request << "," << first_request << std::endl;
+         }
+         
+         if (recurse == 10) exit (-1);
+         
          if (this->mustBeSent()) 
             this->sendCurrentBuffer();
@@ -87,9 +101,22 @@
          if (rsize <= usize)
          {
-            cbuffer.appendRequestInfos(managerId, methodId, nbargs);        
+            cbuffer.appendRequestInfos(managerId, methodId, nbargs);
+            recurse = 0;       
          }
          else
          {
-            this->wait();
+            int o = this->wait();
+            recurse ++;
+            if (recurse > 1)
+            {
+               
+               std::cout << "putain bis:" <<  recurse << "," << this->mustBeSent()  << "," << CMPIManager::Test (o)
+                         << "," << currentBuffer << "," << first.getUsedSize() << "," << second.getUsedSize();
+               if ((currentBuffer  ==  0) && (first.getUsedSize()  != 0) && (second_request != -1))
+                  std::cout << "," << CMPIManager::Test (second_request);
+               if ((currentBuffer  ==  1) && (second.getUsedSize()  != 0) && (first_request != -1))
+                  std::cout << "," << CMPIManager::Test (first_request);
+               std::cout << "," << second_request << "," << first_request << "," << o << std::endl;
+            }
             this->prepareRequest(managerId, methodId, arg1, arg2, arg3, arg4);
          }
Index: /XMLIO_V2/dev/dev_rv/src/xmlio/circular_buffer.cpp
===================================================================
--- /XMLIO_V2/dev/dev_rv/src/xmlio/circular_buffer.cpp	(revision 197)
+++ /XMLIO_V2/dev/dev_rv/src/xmlio/circular_buffer.cpp	(revision 198)
@@ -50,9 +50,9 @@
          nbargs    = SuperClass::getInt(startpos + currsize);
          currsize += SuperClass::getRequestedSize(nbargs);
-
+         
          for (long int i = 0; i < nbargs; i++)
          {
             CBufferData bufdata;
-            SuperClass::getBufferData(bufdata, currsize);
+            SuperClass::getBufferData(bufdata, startpos + currsize);
             currsize += (bufdata.size + DATA_HEADER_SIZE);
          }
@@ -66,6 +66,9 @@
          StdSize startpos = this-> p_read;
          StdSize currsize = this->getNextRequestSize();
+        
          this->movePRead(currsize);
          this->nbrequest--;
+         std::cout <<  this->nbrequest << std::endl;
+        
          return (CLinearBuffer(SuperClass::getData(startpos), currsize));
       }
@@ -111,11 +114,20 @@
       {
          this-> p_read += data_size;
+         if ((this-> p_read == this-> p_unused) &&
+             (this-> p_read == this-> p_write))
+         {
+            this->clear();
+         }
+         
          if (this-> p_read == this-> p_unused)
          {
             this-> p_unused = this-> p_write;
             this-> p_read   = 0;
+            return;
          }
          if (this-> p_read == this-> p_write)
+         {
             this->clear();
+         }
       }
       
@@ -209,15 +221,21 @@
       void CCircularBuffer::updateNbRequests(StdSize data_begin, StdSize data_end)
       {
-         StdSize position = data_begin, i = 0;
+         StdSize position = data_begin;        
          while (position != data_end)
          {
-            i++;
             this->nbrequest++;
-            position = SuperClass::getNextDataPosition(position); // manager id
-            position = SuperClass::getNextDataPosition(position); // method id
+            position = SuperClass::getNextDataPosition(position); // manager id           
+            position = SuperClass::getNextDataPosition(position); // method id           
+            SuperClass::updateBufferData(position);
             long int nbarg = SuperClass::getInt(position);
             position = SuperClass::getNextDataPosition(position);
             for (long int i = 0; i < nbarg; i++)
                position = SuperClass::getNextDataPosition(position);
+               
+            if (position > data_end)
+              ERROR("CCircularBuffer::updateNbRequests(StdSize data_begin, StdSize data_end)",
+                     << "[ position courante" << position
+                     << ", fin de traitement" << data_end << " ] "
+                     << "Impossible de mettre Ã  jour la liste des requÃªtes !");
          }
       }
Index: /XMLIO_V2/dev/dev_rv/src/xmlio/config/properties.conf
===================================================================
--- /XMLIO_V2/dev/dev_rv/src/xmlio/config/properties.conf	(revision 197)
+++ /XMLIO_V2/dev/dev_rv/src/xmlio/config/properties.conf	(revision 198)
@@ -16,5 +16,5 @@
 /// Buffer Size ///
 DECLARE_PROPERTY (StdSize, BUFFER_CLIENT_SIZE, 1E6) // 1 Mo
-DECLARE_PROPERTY (StdSize, BUFFER_SERVER_SIZE, 1E6) // 10 Mo
+DECLARE_PROPERTY (StdSize, BUFFER_SERVER_SIZE, 10E6) // 10 Mo
 
 
Index: /XMLIO_V2/dev/dev_rv/src/xmlio/linear_buffer.cpp
===================================================================
--- /XMLIO_V2/dev/dev_rv/src/xmlio/linear_buffer.cpp	(revision 197)
+++ /XMLIO_V2/dev/dev_rv/src/xmlio/linear_buffer.cpp	(revision 198)
@@ -34,11 +34,23 @@
 
       void CLinearBuffer::clear(void)
-      { this->bdata.clear(); this->p_write = 0; }
-
+      { 
+         this->bdata.clear();
+         //SuperClass::fillData('\0', SuperClass::getSize(), 0);
+         this->p_write = 0;
+      }
+      
+      //---------------------------------------------------------------
+      
       StdSize CLinearBuffer::getUsedSize(void) const
-      { return (this->p_write); }
-
+      { 
+         return (this->p_write); 
+      }
+      
+      //---------------------------------------------------------------
+      
       StdSize CLinearBuffer::getUnusedSize(void) const
-      { return (SuperClass::getSize() - this->getUsedSize()); }
+      {
+          return (SuperClass::getSize() - this->getUsedSize()); 
+      }
 
       //---------------------------------------------------------------
Index: /XMLIO_V2/dev/dev_rv/src/xmlio/main_server.cpp
===================================================================
--- /XMLIO_V2/dev/dev_rv/src/xmlio/main_server.cpp	(revision 197)
+++ /XMLIO_V2/dev/dev_rv/src/xmlio/main_server.cpp	(revision 198)
@@ -15,4 +15,7 @@
    try
    {
+      ARRAY_CREATE(value0, double, 1, [200]);
+      ARRAY_CREATE(value1, double, 1, [1000]);
+      ARRAY_CREATE(value2, double, 1, [2000]);
       comm::CMPIManager::Initialise(&argc, &argv); // < seulement en mode connectÃ©
       
@@ -22,11 +25,23 @@
          server.run();
          std::cout << "fin serveur" << std::endl;
+         comm::CMPIManager::Barrier();
          
       }
       else
       {
+         
          comm::CClient client(comm::CMPIManager::GetCommWorld());
          client.initialize();
+         client.setContext("lol");
+         
+         for (int j = 0; j < 10000; j++)
+         {
+            client.updateCalendar(j);
+            client.sendData("mon_champ0", value0);
+            client.sendData("mon_champ1", value1);
+            client.sendData("mon_champ2", value2);
+         }
          client.finalize();
+         comm::CMPIManager::Barrier();
       }
       
Index: /XMLIO_V2/dev/dev_rv/src/xmlio/server.cpp
===================================================================
--- /XMLIO_V2/dev/dev_rv/src/xmlio/server.cpp	(revision 197)
+++ /XMLIO_V2/dev/dev_rv/src/xmlio/server.cpp	(revision 198)
@@ -26,16 +26,17 @@
       while (this->blist.recvRequests())
       {
-         long int managerId = 0, methodId  = 0, nbargs  = 0;
-         long int managerId_= 0, methodId_ = 0, nbargs_ = 0;
+         long int managerId = -1, methodId  = -1, nbargs  = -1;
+         long int managerId_= -1, methodId_ = -1, nbargs_ = -1;
          std::vector<CLinearBuffer> lbuffer;
          this->blist.getRequests(lbuffer);
+                 
          for (StdSize i = 0; i < lbuffer.size(); i++)
-         {
+         {           
             lbuffer[i].getRequestInfos(0, managerId, methodId, nbargs);
             if (((managerId_ != managerId) || (methodId_ != methodId) || (nbargs_ != nbargs)) && (i != 0 ))
             {
-               /*std::cout << managerId_ << "<->" << managerId << std::endl
-                           << methodId_  << "<->" << methodId  << std::endl
-                           << nbargs_    << "<->" << nbargs    << std::endl;*/
+               //std::cout << managerId_ << "<->" << managerId << std::endl
+               //          << methodId_  << "<->" << methodId  << std::endl
+               //          << nbargs_    << "<->" << nbargs    << std::endl;
                ERROR("CServer::run(void)", << "[" << i << "] Les requÃªtes ne sont pas synchronisÃ©es !");
             }
@@ -119,12 +120,25 @@
    {
       std::cout << "finalize called " << std::endl;
-   }
-   
+   }   
    
    //--------------------------------------------------------------
              
    void CServer::setContext(const std::vector<CLinearBuffer> & buffer) // manager 1, method 0
-   {
-      std::cout << "setContext called " << std::endl;
+   { 
+      StdString contextId;
+      for (StdSize i = 0; i < buffer.size(); i++)
+      {
+         StdString contextId_ = buffer[i].getString(3);
+         if (contextId.compare(contextId_) != 0 && (i != 0))
+         {
+            ERROR("CServer::setContext(const std::vector<CLinearBuffer> & buffer)", 
+                  << "[ contextId 1 = " << contextId   << ", "
+                  << "[ contextId 2 = " << contextId_  << "] "
+                  << " Changement de contexte dÃ©synchronisÃ© !");
+         }
+         else contextId = contextId_;
+         
+      }
+      std::cout << "setContext called " << contextId << std::endl;
    }
    
@@ -133,5 +147,19 @@
    void CServer::updateCalendar(const std::vector<CLinearBuffer> & buffer) // manager 1, method 1
    {
-      std::cout << "updateCalendar called " << std::endl;
+      int timestep = -1;
+      for (StdSize i = 0; i < buffer.size(); i++)
+      {
+         int timestep_ = buffer[i].getInt(3);
+         if ((timestep_ != timestep)  && (i != 0))
+         {
+            ERROR("CServer::updateCalendar(const std::vector<CLinearBuffer> & buffer)", 
+                  << "[ timestep 1 = " << timestep   << ", "
+                  << "[ timestep 2 = " << timestep_  << "] "
+                  << " Mise Ã  jour du calendrier dÃ©synchronisÃ©e !");
+         }
+         else timestep = timestep_;
+         
+      }
+      std::cout << "updateCalendar called " << timestep <<std::endl;
    }
    
@@ -140,5 +168,41 @@
    void CServer::writeData(const std::vector<CLinearBuffer> & buffer, int prec)  // manager 2, method 0 - 1
    {
-      std::cout << "writeData called " << std::endl;
+      StdString fieldId;
+      for (StdSize i = 0; i < buffer.size(); i++)
+      {
+         StdString fieldId_ = buffer[i].getString(3);
+         if (fieldId.compare(fieldId_) != 0 && (i != 0))
+         {           
+            ERROR("CServer::writeData(const std::vector<CLinearBuffer> & buffer, int prec)", 
+                  << "[fieldId 1 = " << fieldId   << ", "
+                  << " fieldId 2 = " << fieldId_  << "] "
+                  << " Ecriture des donnÃ©es dÃ©synchronisÃ©e !");
+         }
+         else fieldId = fieldId_;         
+      }
+      
+      if (prec == 4)
+      {
+         std::deque<ARRAY(float, 1)> dataArray(buffer.size());
+         for (StdSize i = 0; i < buffer.size(); i++)
+            dataArray[i] = buffer[i].getFloatArray(4);
+
+         std::cout << "writeData called (float) " << fieldId << ", " << dataArray[0] << std::endl;
+         return;
+      }      
+      else if (prec == 8)
+      {
+         std::deque<ARRAY(double, 1)> dataArray(buffer.size());
+         for (StdSize i = 0; i < buffer.size(); i++)
+            dataArray[i] = buffer[i].getDoubleArray(4);
+
+         std::cout << "writeData called (double) " << fieldId << ", " << dataArray[0]  << std::endl;
+         return;
+      }      
+      else
+      {
+         ERROR("CServer::writeData(const std::vector<CLinearBuffer> & buffer, int prec)", 
+               << " PrÃ©cision des donnÃ©es invalide !");
+      }
    }
   
