]> AND Private Git Repository - loba.git/blobdiff - process.cpp
Logo AND Algorithmique Numérique Distribuée

Private GIT Repository
Merge branch 'master' of ssh://info.iut-bm.univ-fcomte.fr/loba
[loba.git] / process.cpp
index 338f20de49438d0e2f62708d529df4ecdafcbe39..53cbb59c7434da4a84beb5d2971e8c98ea7ae910 100644 (file)
@@ -234,7 +234,7 @@ void process::receive(bool wait)
     message* msg;
     m_host_t from;
 
     message* msg;
     m_host_t from;
 
-    if (may_receive() && comm.recv(msg, from, wait)) {
+    while (may_receive() && comm.recv(msg, from, wait)) {
         switch (msg->get_type()) {
         case message::INFO: {
             neighbor* n = rev_neigh[from];
         switch (msg->get_type()) {
         case message::INFO: {
             neighbor* n = rev_neigh[from];
@@ -261,6 +261,7 @@ void process::receive(bool wait)
             break;
         }
         delete msg;
             break;
         }
         delete msg;
+        wait = false;           // only wait on first recv
     }
 }
 
     }
 }