reSIProcate
SIP stack, Dialog Usage Manager and related libraries
Loading...
Searching...
No Matches
resip::CongestionManager Class Referenceabstract

Abstract base class that provides a basic congestion management interface. More...

#include <CongestionManager.hxx>

Inheritance diagram for resip::CongestionManager:
[legend]

Public Types

enum  RejectionBehavior { NORMAL =0 , REJECTING_NEW_WORK =1 , REJECTING_NON_ESSENTIAL =2 }
 

Public Member Functions

 CongestionManager ()
 Constructor.
 
virtual ~CongestionManager ()
 
virtual RejectionBehavior getRejectionBehavior (const FifoStatsInterface *fifo) const =0
 Return the current rejection behavior for this fifo.
 
virtual void registerFifo (resip::FifoStatsInterface *fifo)=0
 Registers a fifo with the congestion manager.
 
virtual void unregisterFifo (resip::FifoStatsInterface *fifo)=0
 Unregisters a fifo with the congestion manager.
 
virtual void logCurrentState () const =0
 Log the current state of all monitored fifos.
 
virtual EncodeStream & encodeCurrentState (EncodeStream &strm) const =0
 Get the current state of all monitored fifos.to a stream.
 

Detailed Description

Abstract base class that provides a basic congestion management interface.

The primary job of subclasses is to implement getRejectionBehavior() such that it will return REJECTING_NEW_WORK or REJECTING_NON_ESSENTIAL when sufficient congestion is detected in the fifo in question. logCurrentState() is used to provide a logging statement for the current state of the queueing system.

In order to write a CongestionManager that determines congestion state for specific fifos based on the state of the whole system, you will need to override getRejectionBehavior() to examine the fifo being passed to determine what role it has in the system (this is done by calling FifoStatsInterface::getDescription()), and assigning a role-number that designates the role of this fifo (this means you only need to perform a string comparison the first time getRejectionBehavior() is called for a particular fifo). Here are the returns you will get from FifoStatsInterface::getDescription() on a number of key fifos in the resiprocate stack:

The following fifos don't see much use, and are therefore not that vital, but they do have descriptions.

  • SipStack::mTUFifo
  • TuSelector::mShutdownFifo

Definition at line 43 of file CongestionManager.hxx.

Member Enumeration Documentation

◆ RejectionBehavior

Enumerator
NORMAL 

Not rejecting any work.

REJECTING_NEW_WORK 

Overloaded, should refuse new work.

Should not refuse continuation of old work.

REJECTING_NON_ESSENTIAL 

Rejecting all work that is non-essential to the health of the system (ie, if dropping something is liable to cause a leak, instability, or state-bloat, don't drop it.

Otherwise, reject it.)

Definition at line 54 of file CongestionManager.hxx.

Constructor & Destructor Documentation

◆ CongestionManager()

resip::CongestionManager::CongestionManager ( )
inline

Constructor.

Definition at line 51 of file CongestionManager.hxx.

◆ ~CongestionManager()

virtual resip::CongestionManager::~CongestionManager ( )
inlinevirtual

Definition at line 52 of file CongestionManager.hxx.

Member Function Documentation

◆ encodeCurrentState()

virtual EncodeStream & resip::CongestionManager::encodeCurrentState ( EncodeStream &  strm) const
pure virtual

Get the current state of all monitored fifos.to a stream.

Implemented in resip::GeneralCongestionManager.

◆ getRejectionBehavior()

virtual RejectionBehavior resip::CongestionManager::getRejectionBehavior ( const FifoStatsInterface *  fifo) const
pure virtual

Return the current rejection behavior for this fifo.

This is the primary functionality provided by this class. Implementors may merely examine the current state of the fifo in question, or they may make the decision based on the state of the entire system.

Parameters
fifoThe fifo in question.
Returns
The current desired RejectionBehavior for the fifo.

Implemented in resip::GeneralCongestionManager.

◆ logCurrentState()

virtual void resip::CongestionManager::logCurrentState ( ) const
pure virtual

Log the current state of all monitored fifos.

Implemented in resip::GeneralCongestionManager.

◆ registerFifo()

virtual void resip::CongestionManager::registerFifo ( resip::FifoStatsInterface *  fifo)
pure virtual

Registers a fifo with the congestion manager.

May be a no-op, or may assign a role number to the fifo.

Implemented in resip::GeneralCongestionManager.

◆ unregisterFifo()

virtual void resip::CongestionManager::unregisterFifo ( resip::FifoStatsInterface *  fifo)
pure virtual

Unregisters a fifo with the congestion manager.

Implemented in resip::GeneralCongestionManager.


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