forest-net
an overlay networks for large-scale virtual worlds
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator
forest::Repeater Class Reference

Class to manage repeated sending of control packets. More...

#include <Repeater.h>

Collaboration diagram for forest::Repeater:

Public Member Functions

 Repeater (int)
 Constructor for Repeater.
 
 ~Repeater ()
 Destructor for Repeater. More...
 
int saveReq (int, int64_t, int64_t, int=0)
 Save a copy of an outgoing request packet. More...
 
pair< int, int > deleteMatch (int64_t)
 Match a reply to a saved request and update. More...
 
pair< int, int > overdue (int64_t)
 Check for an overdue packet. More...
 

Private Attributes

int n
 
HashMap< int64_t, Pair< int,
int >, Hash::s64 > * 
pmap
 maps seqNum->(pktx,repCount)
 
Dheap< int64_t > * deadlines
 heap of packets waiting on replies
 

Detailed Description

Class to manage repeated sending of control packets.

Definition at line 28 of file Repeater.h.

Constructor & Destructor Documentation

forest::Repeater::~Repeater ( )

Destructor for Repeater.

Definition at line 21 of file Repeater.cpp.

Member Function Documentation

pair< int, int > forest::Repeater::deleteMatch ( int64_t  seqNum)

Match a reply to a saved request and update.

Parameters
seqNumis the sequence number assigned to the reply
Returns
the index associated with the saved copy or 0 if no match

Definition at line 43 of file Repeater.cpp.

Here is the caller graph for this function:

pair< int, int > forest::Repeater::overdue ( int64_t  now)

Check for an overdue packet.

Parameters
nowis the current time
Returns
a pair (cx, idx) where cx is the packet index for an overdue packet that was saved earlier; idx is the index under which the packet was saved; if the packet has been overdue more than the allowed number of times (3), the value of cx is negated to signal this condition and the save copy is removed

Definition at line 60 of file Repeater.cpp.

Here is the caller graph for this function:

int forest::Repeater::saveReq ( int  cx,
int64_t  seqNum,
int64_t  now,
int  idx = 0 
)

Save a copy of an outgoing request packet.

Parameters
cxis a copy of some outgoing request packet
seqNumis the sequence number assigned to the packet
nowis the current time
idxis an optional index that identifies the saved copy; if zero, an index is assigned automatically
Returns
the index associated with the saved copy or 0 if a specified index is not available

Definition at line 32 of file Repeater.cpp.

Here is the caller graph for this function:


The documentation for this class was generated from the following files: