reSIProcate/stack  9694
Public Member Functions | Static Public Attributes | Private Member Functions | Private Attributes | Friends
resip::TransactionController Class Reference

#include <TransactionController.hxx>

Collaboration diagram for resip::TransactionController:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 TransactionController (SipStack &stack, AsyncProcessHandler *handler)
 ~TransactionController ()
void process (int timeout=0)
unsigned int getTimeTillNextProcessMS ()
void shutdown ()
TransportSelectortransportSelector ()
const TransportSelectortransportSelector () const
bool isTUOverloaded () const
void send (SipMessage *msg)
unsigned int getTuFifoSize () const
unsigned int sumTransportFifoSizes () const
unsigned int getTransactionFifoSize () const
unsigned int getNumClientTransactions () const
unsigned int getNumServerTransactions () const
unsigned int getTimerQueueSize () const
void zeroOutStatistics ()
void pollStatistics ()
void setCongestionManager (CongestionManager *manager)
CongestionManager::RejectionBehavior getRejectionBehavior () const
void registerMarkListener (MarkListener *listener)
void unregisterMarkListener (MarkListener *listener)
bool getFixBadDialogIdentifiers () const
void setFixBadDialogIdentifiers (bool pFixBadDialogIdentifiers)
bool getFixBadCSeqNumbers () const
void setFixBadCSeqNumbers (bool pFixBadCSeqNumbers)
void abandonServerTransaction (const Data &tid)
void cancelClientInviteTransaction (const Data &tid)
void terminateFlow (const resip::Tuple &flow)
void enableFlowTimer (const resip::Tuple &flow)
void setInterruptor (AsyncProcessHandler *handler)

Static Public Attributes

static unsigned int MaxTUFifoSize = 0
static unsigned int MaxTUFifoTimeDepthSecs = 0

Private Member Functions

 TransactionController (const TransactionController &rhs)
TransactionControlleroperator= (const TransactionController &rhs)

Private Attributes

SipStackmStack
bool mDiscardStrayResponses
bool mFixBadDialogIdentifiers
bool mFixBadCSeqNumbers
Fifo< TransactionMessagemStateMacFifo
ConsumerFifoBuffer
< TransactionMessage
mStateMacFifoOutBuffer
CongestionManagermCongestionManager
Fifo< TimerMessagemTimerFifo
TuSelectormTuSelector
TransportSelector mTransportSelector
TransactionMap mClientTransactionMap
TransactionMap mServerTransactionMap
TransactionTimerQueue mTimers
bool mShuttingDown
StatisticsManagermStatsManager
Data mHostname

Friends

class SipStack
class StatelessHandler
class TransactionState
class TransportSelector
class TestDnsResolver
class TestFSM

Detailed Description

Definition at line 23 of file TransactionController.hxx.


Constructor & Destructor Documentation

TransactionController::TransactionController ( SipStack stack,
AsyncProcessHandler handler 
)
TransactionController::~TransactionController ( )

Definition at line 63 of file TransactionController.cxx.

References mClientTransactionMap, mServerTransactionMap, resip::TransactionMap::size(), and WarningLog.

{
   if(mClientTransactionMap.size())
   {
      WarningLog(<< "On shutdown, there are Client TransactionStates remaining!");
   }

   if(mServerTransactionMap.size())
   {
      WarningLog(<< "On shutdown, there are Server TransactionStates remaining!");
   }
}

Here is the call graph for this function:

resip::TransactionController::TransactionController ( const TransactionController rhs) [private]

Member Function Documentation

void TransactionController::abandonServerTransaction ( const Data tid)

Definition at line 245 of file TransactionController.cxx.

References resip::Fifo< Msg >::add(), and mStateMacFifo.

Referenced by resip::SipStack::abandonServerTransaction().

Here is the call graph for this function:

void TransactionController::cancelClientInviteTransaction ( const Data tid)

Definition at line 251 of file TransactionController.cxx.

References resip::Fifo< Msg >::add(), and mStateMacFifo.

Referenced by resip::SipStack::cancelClientInviteTransaction().

Here is the call graph for this function:

void TransactionController::enableFlowTimer ( const resip::Tuple flow)

Definition at line 263 of file TransactionController.cxx.

References resip::Fifo< Msg >::add(), and mStateMacFifo.

Referenced by resip::SipStack::enableFlowTimer().

Here is the call graph for this function:

bool resip::TransactionController::getFixBadCSeqNumbers ( ) const [inline]
bool resip::TransactionController::getFixBadDialogIdentifiers ( ) const [inline]

Definition at line 82 of file TransactionController.hxx.

References mFixBadDialogIdentifiers.

Referenced by resip::TransactionState::process().

unsigned int TransactionController::getNumClientTransactions ( ) const

Definition at line 204 of file TransactionController.cxx.

References mClientTransactionMap, and resip::TransactionMap::size().

Referenced by resip::StatisticsManager::poll().

Here is the call graph for this function:

unsigned int TransactionController::getNumServerTransactions ( ) const

Definition at line 210 of file TransactionController.cxx.

References mServerTransactionMap, and resip::TransactionMap::size().

Referenced by resip::StatisticsManager::poll().

Here is the call graph for this function:

CongestionManager::RejectionBehavior resip::TransactionController::getRejectionBehavior ( ) const [inline]

Definition at line 70 of file TransactionController.hxx.

References resip::CongestionManager::getRejectionBehavior(), mCongestionManager, mStateMacFifo, and resip::CongestionManager::NORMAL.

Referenced by resip::TransactionState::processTimer(), and send().

      {
         if(mCongestionManager)
         {
            return mCongestionManager->getRejectionBehavior(&mStateMacFifo);
         }
         return CongestionManager::NORMAL;
      }

Here is the call graph for this function:

unsigned int TransactionController::getTimerQueueSize ( ) const

Definition at line 216 of file TransactionController.cxx.

References mTimers, and resip::TimerQueue< T >::size().

Referenced by resip::StatisticsManager::poll().

{
   return mTimers.size();
}

Here is the call graph for this function:

unsigned int TransactionController::getTimeTillNextProcessMS ( )
unsigned int TransactionController::getTransactionFifoSize ( ) const

Definition at line 196 of file TransactionController.cxx.

References mStateMacFifo, and resip::AbstractFifo< T >::size().

Referenced by resip::StatisticsManager::poll().

{
   // Should we include the stuff in mStateMacFifoOutBuffer here too? This is
   // likely to be called from other threads...
   return mStateMacFifo.size();
}

Here is the call graph for this function:

unsigned int TransactionController::getTuFifoSize ( ) const

Definition at line 184 of file TransactionController.cxx.

References mTuSelector, and resip::TuSelector::size().

Referenced by resip::StatisticsManager::poll().

{
   return mTuSelector.size();
}

Here is the call graph for this function:

bool TransactionController::isTUOverloaded ( ) const

Definition at line 78 of file TransactionController.cxx.

References mTuSelector, and resip::TuSelector::wouldAccept().

Here is the call graph for this function:

TransactionController& resip::TransactionController::operator= ( const TransactionController rhs) [private]
void TransactionController::pollStatistics ( )

Definition at line 228 of file TransactionController.cxx.

References resip::Fifo< Msg >::add(), and mStateMacFifo.

Referenced by resip::SipStack::pollStatistics().

Here is the call graph for this function:

void TransactionController::process ( int  timeout = 0)

dcm! -- send to all?

Definition at line 91 of file TransactionController.cxx.

References resip::TuSelector::add(), resip::Fifo< Msg >::getNext(), resip::ConsumerFifoBuffer< class >::getNext(), resip::TransportSelector::isFinished(), resip::ConsumerFifoBuffer< class >::messageAvailable(), resip::AbstractFifo< T >::messageAvailable(), mShuttingDown, mStack, mStateMacFifoOutBuffer, resip::TimerQueue< T >::msTillNextTimer(), mTimerFifo, mTimers, mTransportSelector, resip::SipStack::mTUFifo, mTuSelector, resip::TransportSelector::poke(), resip::TimerQueue< T >::process(), resip::TransactionState::processTimer(), and resip::resipMin().

Referenced by resip::SipStack::processTimers(), and resip::TransactionControllerThread::thread().

{
   if (mShuttingDown && 
       //mTimers.empty() && 
       !mStateMacFifoOutBuffer.messageAvailable() && // !dcm! -- see below 
       !mStack.mTUFifo.messageAvailable() &&
       mTransportSelector.isFinished())
// !dcm! -- why would one wait for the Tu's fifo to be empty before delivering a
// shutdown message?
   {
      mTuSelector.add(new ShutdownMessage, TimeLimitFifo<Message>::InternalElement);
   }
   else
   {
      unsigned int nextTimer(mTimers.msTillNextTimer());
      timeout=resipMin((int)nextTimer, timeout);
      if(timeout==0)
      {
         // *sigh*
         timeout=-1;
      }

      // If non-zero is passed for timeout, we understand that the caller is ok
      // with us waiting up to that long on this call. A non-zero timeout is
      // passed by TransactionControllerThread, for example. This gets us 
      // something approximating a blocking wait on both the state machine fifo 
      // and the timer queue.
      TransactionMessage* message=mStateMacFifoOutBuffer.getNext(timeout);

      // If we either had timers ready to go at the beginning of this call, or
      // the getNext() call above timed out, our timer queue is likely ready to 
      // be serviced.
      if(!message || nextTimer==0)
      {
         mTimers.process();
         TimerMessage* timer;
         while ((timer=mTimerFifo.getNext(-1)))
         {
            TransactionState::processTimer(*this,timer);
         }
      }

      if(message)
      {
         // Only do 16 at a time; don't let the timer queue (or other 
         // processing) starve.
         int runs=16;
         while(message)
         {
            TransactionState::process(*this, message);
            if(--runs==0)
            {
               break;
            }
            message = mStateMacFifoOutBuffer.getNext(-1);
         }

         mTransportSelector.poke();
      }
   }
}

Here is the call graph for this function:

void TransactionController::registerMarkListener ( MarkListener listener)

Definition at line 234 of file TransactionController.cxx.

References mTransportSelector, and resip::TransportSelector::registerMarkListener().

Referenced by resip::SipStack::registerMarkListener().

Here is the call graph for this function:

void TransactionController::send ( SipMessage msg)
void resip::TransactionController::setCongestionManager ( CongestionManager manager) [inline]
void resip::TransactionController::setFixBadCSeqNumbers ( bool  pFixBadCSeqNumbers) [inline]

Definition at line 93 of file TransactionController.hxx.

References mFixBadCSeqNumbers.

Referenced by resip::SipStack::setFixBadCSeqNumbers().

      {
         mFixBadCSeqNumbers = pFixBadCSeqNumbers;
      }
void resip::TransactionController::setFixBadDialogIdentifiers ( bool  pFixBadDialogIdentifiers) [inline]

Definition at line 87 of file TransactionController.hxx.

References mFixBadDialogIdentifiers.

      {
         mFixBadDialogIdentifiers = pFixBadDialogIdentifiers;
      }
void TransactionController::setInterruptor ( AsyncProcessHandler handler)

Definition at line 269 of file TransactionController.cxx.

References mStateMacFifo, and resip::Fifo< Msg >::setInterruptor().

Referenced by resip::TransactionControllerThread::TransactionControllerThread().

Here is the call graph for this function:

void TransactionController::shutdown ( )

Definition at line 84 of file TransactionController.cxx.

References mShuttingDown, mTransportSelector, and resip::TransportSelector::shutdown().

Referenced by resip::SipStack::shutdown().

Here is the call graph for this function:

unsigned int TransactionController::sumTransportFifoSizes ( ) const

Definition at line 190 of file TransactionController.cxx.

References mTransportSelector, and resip::TransportSelector::sumTransportFifoSizes().

Referenced by resip::StatisticsManager::poll().

Here is the call graph for this function:

void TransactionController::terminateFlow ( const resip::Tuple flow)

Definition at line 257 of file TransactionController.cxx.

References resip::Fifo< Msg >::add(), and mStateMacFifo.

Referenced by resip::SipStack::terminateFlow().

Here is the call graph for this function:

TransportSelector& resip::TransactionController::transportSelector ( ) [inline]
const TransportSelector& resip::TransactionController::transportSelector ( ) const [inline]

Definition at line 41 of file TransactionController.hxx.

References mTransportSelector.

{ return mTransportSelector; }
void TransactionController::unregisterMarkListener ( MarkListener listener)

Definition at line 239 of file TransactionController.cxx.

References mTransportSelector, and resip::TransportSelector::unregisterMarkListener().

Referenced by resip::SipStack::unregisterMarkListener().

Here is the call graph for this function:

void TransactionController::zeroOutStatistics ( )

Definition at line 222 of file TransactionController.cxx.

References resip::Fifo< Msg >::add(), and mStateMacFifo.

Referenced by resip::SipStack::zeroOutStatistics().

Here is the call graph for this function:


Friends And Related Function Documentation

friend class SipStack [friend]

Definition at line 155 of file TransactionController.hxx.

friend class StatelessHandler [friend]

Definition at line 156 of file TransactionController.hxx.

friend class TestDnsResolver [friend]

Definition at line 160 of file TransactionController.hxx.

friend class TestFSM [friend]

Definition at line 161 of file TransactionController.hxx.

friend class TransactionState [friend]

Definition at line 157 of file TransactionController.hxx.

friend class TransportSelector [friend]

Definition at line 158 of file TransactionController.hxx.


Member Data Documentation

unsigned int TransactionController::MaxTUFifoSize = 0 [static]

Definition at line 27 of file TransactionController.hxx.

Referenced by resip::SipStack::SipStack().

Definition at line 28 of file TransactionController.hxx.

Referenced by resip::SipStack::SipStack().

Definition at line 124 of file TransactionController.hxx.

Referenced by getRejectionBehavior(), and setCongestionManager().

Definition at line 116 of file TransactionController.hxx.

Referenced by getFixBadCSeqNumbers(), and setFixBadCSeqNumbers().

Definition at line 149 of file TransactionController.hxx.

Referenced by process(), and shutdown().

Definition at line 123 of file TransactionController.hxx.

Referenced by getTimeTillNextProcessMS(), and process().

Definition at line 133 of file TransactionController.hxx.

Referenced by process().


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