Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

RMCast_UDP_Reliable_Sender.cpp

Go to the documentation of this file.
00001 // $Id: RMCast_UDP_Reliable_Sender.cpp,v 1.1.1.1 2001/12/04 14:33:17 chad Exp $
00002 
00003 #include "RMCast_UDP_Reliable_Sender.h"
00004 #include "RMCast_UDP_Event_Handler.h"
00005 #include "RMCast_Resend_Handler.h"
00006 #include "ace/Reactor.h"
00007 
00008 #if !defined (__ACE_INLINE__)
00009 # include "RMCast_UDP_Reliable_Sender.i"
00010 #endif /* ! __ACE_INLINE__ */
00011 
00012 ACE_RCSID(ace, RMCast_UDP_Reliable_Sender, "$Id: RMCast_UDP_Reliable_Sender.cpp,v 1.1.1.1 2001/12/04 14:33:17 chad Exp $")
00013 
00014 ACE_RMCast_UDP_Reliable_Sender::ACE_RMCast_UDP_Reliable_Sender (ACE_RMCast_Module *user_control)
00015   : user_control_ (user_control)
00016 
00017   // We use a singleton factory, all proxys send their messages to the
00018   // retransmission module.  There should be only control messages
00019   // coming back, so this is OK.
00020   , factory_ (&membership_)
00021   , io_udp_ (&factory_)
00022 {
00023   // Control messages are received by the membership module and passed
00024   // up to the both the retransmission and user modules, we use a fork
00025   // module to do that
00026   this->membership_.next (&this->fork_);
00027 
00028   this->fork_.next (&this->retransmission_);
00029   this->fork_.secondary (user_control);
00030 
00031   // Messages are passed down to the sequencer module
00032   this->next (&this->sequencer_);
00033 
00034   // then to the retransmission module
00035   this->sequencer_.next (&this->retransmission_);
00036 
00037   // Then fork the messages, at this point control messages are sent
00038   // back to the user, other messages continue down to the
00039   // fragmentation layer.
00040   this->retransmission_.next (&this->fragment_);
00041 
00042   // The fragmentation layer delegates all messages to the UDP I/O
00043   // module, that sends every message back to the application.
00044   this->fragment_.next (&this->io_udp_);
00045 }
00046 
00047 ACE_RMCast_UDP_Reliable_Sender::~ACE_RMCast_UDP_Reliable_Sender (void)
00048 {
00049 }
00050 
00051 void
00052 ACE_RMCast_UDP_Reliable_Sender::reactive_incoming_messages (ACE_Reactor *reactor)
00053 {
00054   ACE_RMCast_UDP_Event_Handler *eh;
00055   ACE_NEW (eh, ACE_RMCast_UDP_Event_Handler (&this->io_udp_));
00056 
00057   /// @@ TODO Make sure it is removed from the Reactor at some point
00058   (void) reactor->register_handler (eh, ACE_Event_Handler::READ_MASK);
00059 }
00060 
00061 void
00062 ACE_RMCast_UDP_Reliable_Sender::reactive_resends (ACE_Reactor *reactor,
00063                                          const ACE_Time_Value &period)
00064 {
00065   ACE_RMCast_Resend_Handler *eh;
00066   ACE_NEW (eh, ACE_RMCast_Resend_Handler (&this->retransmission_));
00067 
00068   /// @@ TODO make sure it is removed from the Reactor at some point
00069   (void) reactor->schedule_timer (eh, 0, period, period);
00070 }

Generated on Mon Jun 16 13:12:38 2003 for ACE_RMCast by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002