|
reSIProcate/stack
9694
|
This class is used to create a thread to run the SipStack in. More...
#include <StackThread.hxx>


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 | |
| SipStack & | mStack |
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.
Definition at line 23 of file StackThread.hxx.
| 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()");
}
| virtual void resip::StackThread::afterProcess | ( | ) | [inline, protected, virtual] |
| virtual void resip::StackThread::beforeProcess | ( | ) | [inline, protected, virtual] |
| void StackThread::buildFdSet | ( | FdSet & | fdset | ) | [protected, virtual] |
| 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");
}

SipStack& resip::StackThread::mStack [private] |
Definition at line 38 of file StackThread.hxx.
Referenced by thread().
1.7.5.1