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

ACE_RMCast_Receiver_Module Class Reference

Keep track of the receiver module. More...

#include <RMCast_Receiver_Module.h>

Inheritance diagram for ACE_RMCast_Receiver_Module:

Inheritance graph
[legend]
Collaboration diagram for ACE_RMCast_Receiver_Module:

Collaboration graph
[legend]
List of all members.

Public Types

enum  Receiver_State { RS_NON_EXISTENT, RS_JOINING, RS_JOINED, RS_LEAVING }
 Simple enum used to describe the receiver state transitions. More...


Public Methods

 ACE_RMCast_Receiver_Module (void)
 Constructor. More...

virtual ~ACE_RMCast_Receiver_Module (void)
 Destructor. More...

virtual int data (ACE_RMCast::Data &)
 Push data through the stack. More...

virtual int poll (ACE_RMCast::Poll &)
 Push a polling request through the stack. More...

virtual int ack_join (ACE_RMCast::Ack_Join &)
 Push a message to ack a join request through the stack. More...

virtual int ack_leave (ACE_RMCast::Ack_Leave &)
 Push a message to ack a leave request through the stack. More...

virtual int ack (ACE_RMCast::Ack &)
 Push an ack mesage through the stack. More...

virtual int join (ACE_RMCast::Join &)
 Push a join message through the stack. More...

virtual int leave (ACE_RMCast::Leave &)
 Push a leave message through the stack. More...


Private Methods

void leaving (ACE_RMCast_Proxy *proxy)
 Enter the leaving state, prepare for termination. More...


Private Attributes

int state_
 The current state of the receiver. More...


Detailed Description

Keep track of the receiver module.

A receiver proxy must reject invalid messages and communicate with the sender to join and leave the multicast group.

This module performs all the task related to

Definition at line 32 of file RMCast_Receiver_Module.h.


Member Enumeration Documentation

enum ACE_RMCast_Receiver_Module::Receiver_State
 

Simple enum used to describe the receiver state transitions.

Receivers go through several states before they can fully accept messages, the following comments describe those states, as well as the possible transitions This configuration is pesimistic, any invalid message is cause enough to reclaim all the resources. This partially addresses situations where either accidentally or intentionally a sender is multicasting packets to the wrong group.

NON_EXISTENT JOINING JOINED LEAVING
----------------------------------------------------------------

DATA JOINING JOINING JOINED LEAVING
Send/Join Send/Join Recv/Data Send/Leave

POLL JOINING JOINING JOINED LEAVING
Send/Join Send/Join Send/Ack Send/Leave

ACK_JOIN JOINING JOINED JOINED LEAVING
Send/Join Receive Msg Receive Msg Send/Leave

ACK_LEAVE NON_EXISTENT NON_EXISTENT NON_EXISTENT NON_EXISTENT
Noop Destroy Destroy Destroy

ACK NON_EXISTENT NON_EXISTENT NON_EXISTENT NON_EXISTENT
Noop Destroy Destroy Destroy

JOIN NON_EXISTENT NON_EXISTENT NON_EXISTENT NON_EXISTENT
Noop Destroy Destroy Destroy

LEAVE NON_EXISTENT NON_EXISTENT NON_EXISTENT NON_EXISTENT
Noop Destroy Destroy Destroy

Enumeration values:
RS_NON_EXISTENT 
RS_JOINING 
RS_JOINED 
RS_LEAVING 

Definition at line 86 of file RMCast_Receiver_Module.h.

00087   {
00088     RS_NON_EXISTENT,
00089     RS_JOINING,
00090     RS_JOINED,
00091     RS_LEAVING
00092   };


Constructor & Destructor Documentation

ACE_INLINE ACE_RMCast_Receiver_Module::ACE_RMCast_Receiver_Module void   
 

Constructor.

Definition at line 4 of file RMCast_Receiver_Module.i.

ACE_RMCast_Receiver_Module::~ACE_RMCast_Receiver_Module void    [virtual]
 

Destructor.

Definition at line 15 of file RMCast_Receiver_Module.cpp.

00016 {
00017 }


Member Function Documentation

int ACE_RMCast_Receiver_Module::ack ACE_RMCast::Ack   [virtual]
 

Push an ack mesage through the stack.

Reimplemented from ACE_RMCast_Module.

Definition at line 130 of file RMCast_Receiver_Module.cpp.

00131 {
00132   return -1;
00133 }

int ACE_RMCast_Receiver_Module::ack_join ACE_RMCast::Ack_Join   [virtual]
 

Push a message to ack a join request through the stack.

Reimplemented from ACE_RMCast_Module.

Definition at line 82 of file RMCast_Receiver_Module.cpp.

References ACE_RMCast_Module::ack_join, join, leaving, ACE_RMCast_Proxy::reply_join, RS_JOINED, RS_JOINING, RS_LEAVING, RS_NON_EXISTENT, ACE_RMCast::Ack_Join::source, and state_.

00083 {
00084   switch (this->state_)
00085     {
00086     case RS_NON_EXISTENT:
00087       if (ack_join.source != 0)
00088         {
00089           //ACE_DEBUG ((LM_DEBUG,
00090           //            "Receiver_Module::ack_join - joining\n"));
00091 
00092           this->state_ = RS_JOINING;
00093           ACE_RMCast::Join join;
00094           if (ack_join.source->reply_join (join) != 0)
00095             this->leaving (ack_join.source);
00096         }
00097       break;
00098 
00099     case RS_JOINING:
00100     case RS_JOINED:
00101       //ACE_DEBUG ((LM_DEBUG,
00102       //            "Receiver_Module::ack_join - joined\n"));
00103 
00104       this->state_ = RS_JOINED;
00105       if (this->ACE_RMCast_Module::ack_join (ack_join) != 0)
00106         this->leaving (ack_join.source);
00107       break;
00108 
00109     default:
00110     case RS_LEAVING:
00111       this->leaving (ack_join.source);
00112       break;
00113     }
00114   return 0;
00115 }

int ACE_RMCast_Receiver_Module::ack_leave ACE_RMCast::Ack_Leave   [virtual]
 

Push a message to ack a leave request through the stack.

Reimplemented from ACE_RMCast_Module.

Definition at line 118 of file RMCast_Receiver_Module.cpp.

References ACE_RMCast_Module::ack_leave.

00119 {
00120   //ACE_DEBUG ((LM_DEBUG,
00121   //            "Receiver_Module::ack_leave\n"));
00122 
00123   (void) this->ACE_RMCast_Module::ack_leave (ack_leave);
00124 
00125   // Returning -1 should remove the Proxy from the local set
00126   return -1;
00127 }

int ACE_RMCast_Receiver_Module::data ACE_RMCast::Data   [virtual]
 

Push data through the stack.

Reimplemented from ACE_RMCast_Module.

Definition at line 20 of file RMCast_Receiver_Module.cpp.

References ACE_RMCast_Module::data, join, leaving, ACE_RMCast_Proxy::reply_join, RS_JOINED, RS_JOINING, RS_LEAVING, RS_NON_EXISTENT, ACE_RMCast::Data::source, and state_.

00021 {
00022   switch (this->state_)
00023     {
00024     case RS_NON_EXISTENT:
00025     case RS_JOINING:
00026       if (data.source != 0)
00027         {
00028           //ACE_DEBUG ((LM_DEBUG,
00029           //            "Receiver_Module::data - joining\n"));
00030 
00031           this->state_ = RS_JOINING;
00032           ACE_RMCast::Join join;
00033           if (data.source->reply_join (join) != 0)
00034             this->leaving (data.source);
00035         }
00036       break;
00037 
00038     case RS_JOINED:
00039       // ACE_DEBUG ((LM_DEBUG,
00040       //             "Receiver_Module::data - joined\n"));
00041       if (this->ACE_RMCast_Module::data (data) != 0)
00042         this->leaving (data.source);
00043       break;
00044 
00045     default:
00046     case RS_LEAVING:
00047       this->leaving (data.source);
00048       break;
00049     }
00050   return 0;
00051 }

int ACE_RMCast_Receiver_Module::join ACE_RMCast::Join   [virtual]
 

Push a join message through the stack.

Reimplemented from ACE_RMCast_Module.

Definition at line 136 of file RMCast_Receiver_Module.cpp.

Referenced by ack_join, data, and poll.

00137 {
00138   return -1;
00139 }

int ACE_RMCast_Receiver_Module::leave ACE_RMCast::Leave   [virtual]
 

Push a leave message through the stack.

Reimplemented from ACE_RMCast_Module.

Definition at line 142 of file RMCast_Receiver_Module.cpp.

Referenced by leaving.

00143 {
00144   return -1;
00145 }

void ACE_RMCast_Receiver_Module::leaving ACE_RMCast_Proxy   proxy [private]
 

Enter the leaving state, prepare for termination.

Definition at line 148 of file RMCast_Receiver_Module.cpp.

References ACE_RMCast_Module::close, leave, ACE_RMCast_Proxy::reply_leave, RS_LEAVING, and state_.

Referenced by ack_join, data, and poll.

00149 {
00150   this->state_ = RS_LEAVING;
00151   if (proxy != 0)
00152     {
00153       ACE_RMCast::Leave leave;
00154       (void) proxy->reply_leave (leave);
00155     }
00156   (void) this->close ();
00157 }

int ACE_RMCast_Receiver_Module::poll ACE_RMCast::Poll   [virtual]
 

Push a polling request through the stack.

Reimplemented from ACE_RMCast_Module.

Definition at line 54 of file RMCast_Receiver_Module.cpp.

References join, leaving, ACE_RMCast_Module::poll, ACE_RMCast_Proxy::reply_join, RS_JOINED, RS_JOINING, RS_LEAVING, RS_NON_EXISTENT, ACE_RMCast::Poll::source, and state_.

00055 {
00056   switch (this->state_)
00057     {
00058     case RS_NON_EXISTENT:
00059     case RS_JOINING:
00060       if (poll.source != 0)
00061         {
00062           this->state_ = RS_JOINING;
00063           ACE_RMCast::Join join;
00064           if (poll.source->reply_join (join) != 0)
00065             this->leaving (poll.source);
00066         }
00067       break;
00068 
00069     case RS_JOINED:
00070       if (this->ACE_RMCast_Module::poll (poll) != 0)
00071         this->leaving (poll.source);
00072 
00073     default:
00074     case RS_LEAVING:
00075       this->leaving (poll.source);
00076       break;
00077     }
00078   return 0;
00079 }


Member Data Documentation

int ACE_RMCast_Receiver_Module::state_ [private]
 

The current state of the receiver.

Definition at line 100 of file RMCast_Receiver_Module.h.

Referenced by ack_join, data, leaving, and poll.


The documentation for this class was generated from the following files:
Generated on Mon Jun 16 13:14:11 2003 for ACE_RMCast by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002