00001 // file : ace/RMCast/Simulator.cpp 00002 // author : Boris Kolpackov <boris@kolpackov.net> 00003 // cvs-id : $Id: Simulator.cpp 80826 2008-03-04 14:51:23Z wotte $ 00004 00005 #include "ace/OS_NS_time.h" 00006 #include "Simulator.h" 00007 00008 namespace ACE_RMCast 00009 { 00010 Simulator::Simulator () 00011 { 00012 ACE_OS::srand ((unsigned int)ACE_OS::time (0)); 00013 } 00014 00015 void Simulator::send (Message_ptr m) 00016 { 00017 // Note: Simulator may work in unpredictable ways mainly due 00018 // to the "reliable loopback" mechanism. 00019 // 00020 out_->send (m); 00021 return; 00022 00023 /*int r (rand ()); 00024 00025 if ((r % 3) == 0) return; 00026 00027 Lock l (mutex_); 00028 00029 if (hold_.get ()) 00030 { 00031 out_->send (m); 00032 out_->send (hold_); 00033 } 00034 else 00035 { 00036 hold_ = m; 00037 }*/ 00038 } 00039 }