| EventStudio 2.5 Sequence diagram based system design and modeling | |
#include <Receive_Protocol_Handler.h> Collaboration diagram for Receive_Protocol_Handler:

This class receives the packets from the other end and performs the following operations:
Definition at line 20 of file Receive_Protocol_Handler.h.
Public Member Functions | |
| void | Handle_Received_Packet (Datagram *p_Packet) |
| The Handle Receive Packet method completely handles the receive side processing of the protocol messages. | |
| Receive_Protocol_Handler (Protocol_Layer *p_Layer) | |
| The constructor for the class. | |
Private Attributes | |
| int | m_next_Expected_Sequence_Number |
| Transmit sequence number expected for the next packet. | |
| int | m_last_Acknowledged_Sequence_Number |
| Receive sequence number from the last packet. | |
| Transmit_Protocol_Handler * | m_p_Transmit_Protocol_Handler |
| Pointer to the associated Transmit Protocol Handler. | |
| Protocol_Layer * | m_p_Layer |
| Pointer to the parent layer. Used to obtain a pointer to the upper layer. | |
|
The constructor for the class. The constructor needs a pointer to the parent layer. The Receive Protocol Handler will use this pointer to obtain a pointer to to the upper layer.
Definition at line 107 of file Receive_Protocol_Handler.h. 00107 : 00108 m_p_Layer(p_Layer) 00109 { 00110 } }; |
|
The Handle Receive Packet method completely handles the receive side processing of the protocol messages. This method takes the following actions:
Definition at line 58 of file Receive_Protocol_Handler.h. 00059 {
00060 // Extract the header needed by this layer
00061 p_Packet->Extract_Header(L2_HEADER_LENGTH);
00062
00063 // Compare the packet's transmit sequence number with
00064 // the expected sequence number
00065 if (p_Packet->Get_Transmit_Sequence_Number() == m_next_Expected_Sequence_Number)
00066 {
00067 // Request Transmit Sequence Handler to acknowledge
00068 // the just received packet
00069 m_p_Transmit_Protocol_Handler->Handle_Send_Ack_Request(m_next_Expected_Sequence_Number);
00070
00071 // Pass the message to the higher layer. The message is passed only if the upper layer
00072 // has been specified.
00073 Protocol_Layer *p_Upper_Layer = m_p_Layer->Get_Upper_Layer();
00074 if (p_Upper_Layer)
00075 {
00076 p_Upper_Layer->Handle_Receive(p_Packet);
00077 }
00078
00079 // Modulo increment the next expected sequence number
00080 Modulo_Increment(m_next_Expected_Sequence_Number);
00081 }
00082
00083 // Compare the packet's receive sequence number with the
00084 // last acknowledged sequence number. (Change in sequence number
00085 // implies that an acknowledgement has been received from the other end)
00086 if (p_Packet->Get_Receive_Sequence_Number() != m_last_Acknowledged_Sequence_Number)
00087 {
00088 // Update the last acknowledged sequence number
00089 m_last_Acknowledged_Sequence_Number = p_Packet->Get_Receive_Sequence_Number();
00090
00091 // Inform the Transmit Protocol Handler about the
00092 // acknowledgements received from the other end
00093 m_p_Transmit_Protocol_Handler->Handle_Received_Ack_Notification(
00094 m_last_Acknowledged_Sequence_Number);
00095 }
00096 }
|
|
Receive sequence number from the last packet. Change in the receive sequence number means that the other end is acknowledging some packets Definition at line 30 of file Receive_Protocol_Handler.h. |
1.3.4 | |
| Copyright © 2000-2005 EventHelix.com Inc. All Rights Reserved. |