Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Dirty hack to make sure that all callbacks of a flows that finish exactly at the...
authorLucas Schnorr <Lucas.Schnorr@imag.fr>
Wed, 7 Sep 2011 14:04:37 +0000 (16:04 +0200)
committerLucas Schnorr <Lucas.Schnorr@imag.fr>
Thu, 8 Sep 2011 14:56:11 +0000 (16:56 +0200)
Otherwise, only the first callback is called and the status of the other finishing flow is not updated.

src/surf/ns3/ns3_simulator.cc

index 199d6c6..8e25eba 100644 (file)
@@ -109,7 +109,8 @@ static void receive_callback(Ptr<Socket> localSocket){
     mysocket->finished = 1;
 //    cout << "[" << Simulator::Now ().GetSeconds() << "] " << "recv_cb of F[" << mysocket->totalBytes << "] " << endl;
     XBT_DEBUG("Stop simulator at %f seconds", Simulator::Now().GetSeconds());
     mysocket->finished = 1;
 //    cout << "[" << Simulator::Now ().GetSeconds() << "] " << "recv_cb of F[" << mysocket->totalBytes << "] " << endl;
     XBT_DEBUG("Stop simulator at %f seconds", Simulator::Now().GetSeconds());
-    Simulator::Stop();
+    Simulator::Stop(Seconds(0.0));
+    Simulator::Run();
   }
 }
 
   }
 }