diff options
author | coryan <coryan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2000-10-02 18:40:06 +0000 |
---|---|---|
committer | coryan <coryan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2000-10-02 18:40:06 +0000 |
commit | 3c7edb739b596313a3e15fe1373bd488c2f37009 (patch) | |
tree | ec3f3e0df41c8f76d9c1ae3d472221e78a23d61f /protocols/ace/RMCast/RMCast_Retransmission.h | |
parent | 6c8cdfe85f70b9be20d1dd80f9730dae491ff403 (diff) | |
download | ATCD-3c7edb739b596313a3e15fe1373bd488c2f37009.tar.gz |
ChangeLogTag:Mon Oct 2 11:29:47 2000 Carlos O'Ryan <coryan@uci.edu>
Diffstat (limited to 'protocols/ace/RMCast/RMCast_Retransmission.h')
-rw-r--r-- | protocols/ace/RMCast/RMCast_Retransmission.h | 67 |
1 files changed, 51 insertions, 16 deletions
diff --git a/protocols/ace/RMCast/RMCast_Retransmission.h b/protocols/ace/RMCast/RMCast_Retransmission.h index 7c586fe5dd6..b7bc20d2914 100644 --- a/protocols/ace/RMCast/RMCast_Retransmission.h +++ b/protocols/ace/RMCast/RMCast_Retransmission.h @@ -19,6 +19,7 @@ #include "ace/pre.h" #include "RMCast_Module.h" +#include "RMCast_Copy_On_Write.h" #include "ace/RB_Tree.h" #include "ace/Synch.h" @@ -26,38 +27,72 @@ # pragma once #endif /* ACE_LACKS_PRAGMA_ONCE */ +//! Store messages for retransmission in reliable configurations +/*! + * Reliable configurations of the RMCast framework need to store + * messages on the sender side to resend them if one or more clients + * do not receive them successfully. + */ class ACE_RMCast_Export ACE_RMCast_Retransmission : public ACE_RMCast_Module { - // = TITLE - // Reliable Multicast Retransmission - // - // = DESCRIPTION - // Define the interface for all reliable multicast retransmission public: // = Initialization and termination methods. + //! Constructor ACE_RMCast_Retransmission (void); - // Constructor + //! Destructor virtual ~ACE_RMCast_Retransmission (void); - // Destructor - // = The RMCast_Module methods + //! Use a Red-Black Tree to keep the queue of messages + typedef ACE_RB_Tree<ACE_UINT32,ACE_RMCast::Data,ACE_Less_Than<ACE_UINT32>,ACE_Null_Mutex> Collection; + typedef ACE_RB_Tree_Iterator<ACE_UINT32,ACE_RMCast::Data,ACE_Less_Than<ACE_UINT32>,ACE_Null_Mutex> Collection_Iterator; + + //! The messages are stored in the Copy_On_Write wrapper to provide + //! an efficient, but thread safe interface. + typedef ACE_RMCast_Copy_On_Write<ACE_UINT32,ACE_RMCast::Data,Collection,Collection_Iterator> Messages; + + //! Resend messages + /*! + * Resends all the messages up to \param max_sequence_number + * Returns the number of messages sent, or -1 if there where any + * errors. + */ + int resend (ACE_UINT32 max_sequence_number); + + //! Cleanup all the stored messages virtual int close (void); + + //! Pass the message downstream, but also save it in the + //! retransmission queue + /*! + * Sequence number are assigned by the ACE_RMCast_Fragmentation + * class, consequently this class first passes the message + * downstream, to obtain the sequence number and then stores the + * message for later retransmission. + */ virtual int data (ACE_RMCast::Data &data); + + //! Process an Ack message from the remote receivers. + /*! + * Normally this Ack message will be a summary of all the Ack + * messages received by the ACE_RMCast_Membership class + */ virtual int ack (ACE_RMCast::Ack &); + + //! Detect when new members join the group and Ack_Join them + /*! + * When a new receiver joins the group this module sends an Ack_Join + * message with the next sequence number that the receiver should + * expect. + * The sequence number is obtained from the current list of cached + * messages. + */ virtual int join (ACE_RMCast::Join &); protected: - typedef ACE_RB_Tree<ACE_UINT32,ACE_RMCast::Data,ACE_Less_Than<ACE_UINT32>,ACE_Null_Mutex> - Messages; - typedef ACE_RB_Tree_Iterator<ACE_UINT32,ACE_RMCast::Data,ACE_Less_Than<ACE_UINT32>,ACE_Null_Mutex> - Messages_Iterator; + //! The retransmission buffer Messages messages_; - // The retransmission buffer - - ACE_SYNCH_MUTEX mutex_; - // Synchronization }; #if defined (__ACE_INLINE__) |