reSIProcate/stack  9694
Public Member Functions | Protected Member Functions | Private Attributes
resip::StackThread Class Reference

This class is used to create a thread to run the SipStack in. More...

#include <StackThread.hxx>

Inheritance diagram for resip::StackThread:
Inheritance graph
[legend]
Collaboration diagram for resip::StackThread:
Collaboration graph
[legend]

List of all members.

Public Member Functions

RESIP_DEPRECATED StackThread (SipStack &stack)
virtual ~StackThread ()
virtual void thread ()

Protected Member Functions

virtual void buildFdSet (FdSet &fdset)
virtual unsigned int getTimeTillNextProcessMS () const
virtual void beforeProcess ()
virtual void afterProcess ()

Private Attributes

SipStackmStack

Detailed Description

This class is used to create a thread to run the SipStack in.

The thread provides cycles to the SipStack by calling process. Process is called at least every 25ms, or sooner if select returns a signaled file descriptor.

Deprecated:
This is a deprecated method of giving the SipStack cycles. The current canonical example is EventStackThread.

Definition at line 23 of file StackThread.hxx.


Constructor & Destructor Documentation

StackThread::StackThread ( SipStack stack)

Definition at line 10 of file StackThread.cxx.

   : mStack(stack)
{}
StackThread::~StackThread ( ) [virtual]

Definition at line 14 of file StackThread.cxx.

{
   //InfoLog (<< "StackThread::~StackThread()");
}

Member Function Documentation

virtual void resip::StackThread::afterProcess ( ) [inline, protected, virtual]

Definition at line 38 of file StackThread.hxx.

Referenced by thread().

{};
virtual void resip::StackThread::beforeProcess ( ) [inline, protected, virtual]

Definition at line 37 of file StackThread.hxx.

Referenced by thread().

{};
void StackThread::buildFdSet ( FdSet fdset) [protected, virtual]

Definition at line 49 of file StackThread.cxx.

Referenced by thread().

{}
unsigned int StackThread::getTimeTillNextProcessMS ( ) const [protected, virtual]

Definition at line 53 of file StackThread.cxx.

Referenced by thread().

{
//   !dcm! moved the 25 ms min logic here
//   return INT_MAX;
   return 25;   
}
void StackThread::thread ( ) [virtual]

Implements resip::ThreadIf.

Definition at line 20 of file StackThread.cxx.

References afterProcess(), beforeProcess(), buildFdSet(), resip::SipStack::buildFdSet(), ErrLog, getTimeTillNextProcessMS(), resip::SipStack::getTimeTillNextProcessMS(), resip::ThreadIf::isShutdown(), mStack, resip::SipStack::process(), resip::resipMin(), resip::FdSet::selectMilliSeconds(), and WarningLog.

{
   while (!isShutdown())
   {
      try
      {
         resip::FdSet fdset;
         buildFdSet(fdset);
         mStack.buildFdSet(fdset);
                 int ret = fdset.selectMilliSeconds(resipMin(mStack.getTimeTillNextProcessMS(),
                                                     getTimeTillNextProcessMS()));
         if (ret >= 0)
         {
            // .dlb. use return value to peek at the message to see if it is a
            // shutdown, and call shutdown if it is
            beforeProcess();
            mStack.process(fdset);
            afterProcess();
         }
      }
      catch (BaseException& e)
      {
         ErrLog (<< "Unhandled exception: " << e);
      }
   }
   WarningLog (<< "Shutting down stack thread");
}

Here is the call graph for this function:


Member Data Documentation

Definition at line 38 of file StackThread.hxx.

Referenced by thread().


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