reSIProcate
SIP stack, Dialog Usage Manager and related libraries
Loading...
Searching...
No Matches
StackThread.cxx
Go to the documentation of this file.
4#include "rutil/Logger.hxx"
5
6#define RESIPROCATE_SUBSYSTEM Subsystem::SIP
7
8using namespace resip;
9
11 : mStack(stack)
12{}
13
15{
16 //InfoLog (<< "StackThread::~StackThread()");
17}
18
19/*
20 * StackThread uses the deprecated SipStack API calls,
21 * buildFdSet(fdset) and process(fdset).
22 *
23 * To avoid using these calls, use EventStackThread or call the
24 * new SipStack::process(unsigned int) directly.
25 */
26#ifndef WIN32
27#pragma GCC diagnostic push
28#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
29#else
30#pragma warning(push)
31#pragma warning(disable: 4996)
32#endif
33
34void
36{
37 while (!isShutdown())
38 {
39 try
40 {
41 resip::FdSet fdset;
42 buildFdSet(fdset);
43 mStack.buildFdSet(fdset);
46 if (ret >= 0)
47 {
48 // .dlb. use return value to peek at the message to see if it is a
49 // shutdown, and call shutdown if it is
51 mStack.process(fdset);
53 }
54 }
55 catch (BaseException& e)
56 {
57 ErrLog (<< "Unhandled exception: " << e);
58 }
59 }
60 WarningLog (<< "Shutting down stack thread");
61}
62
63#ifndef WIN32
64#pragma GCC diagnostic pop
65#else
66#pragma warning(pop)
67#endif
68
69void
72
73unsigned int
75{
76// !dcm! moved the 25 ms min logic here
77// return INT_MAX;
78 return 25;
79}
80
81/* ====================================================================
82 * The Vovida Software License, Version 1.0
83 *
84 * Copyright (c) 2000 Vovida Networks, Inc. All rights reserved.
85 *
86 * Redistribution and use in source and binary forms, with or without
87 * modification, are permitted provided that the following conditions
88 * are met:
89 *
90 * 1. Redistributions of source code must retain the above copyright
91 * notice, this list of conditions and the following disclaimer.
92 *
93 * 2. Redistributions in binary form must reproduce the above copyright
94 * notice, this list of conditions and the following disclaimer in
95 * the documentation and/or other materials provided with the
96 * distribution.
97 *
98 * 3. The names "VOCAL", "Vovida Open Communication Application Library",
99 * and "Vovida Open Communication Application Library (VOCAL)" must
100 * not be used to endorse or promote products derived from this
101 * software without prior written permission. For written
102 * permission, please contact vocal@vovida.org.
103 *
104 * 4. Products derived from this software may not be called "VOCAL", nor
105 * may "VOCAL" appear in their name, without prior written
106 * permission of Vovida Networks, Inc.
107 *
108 * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED
109 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
110 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND
111 * NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL VOVIDA
112 * NETWORKS, INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT DAMAGES
113 * IN EXCESS OF $1,000, NOR FOR ANY INDIRECT, INCIDENTAL, SPECIAL,
114 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
115 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
116 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
117 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
118 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
119 * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
120 * DAMAGE.
121 *
122 * ====================================================================
123 *
124 * This software consists of voluntary contributions made by Vovida
125 * Networks, Inc. and many individuals on behalf of Vovida Networks,
126 * Inc. For more information on Vovida Networks, Inc., please see
127 * <http://www.vovida.org/>.
128 *
129 */
#define WarningLog(args_)
Definition Logger.hxx:134
#define ErrLog(args_)
Definition Logger.hxx:137
The abstract base-class for all exceptions thrown by resip code.
Object-oriented wrapper for your platform's file-descriptor set.
Definition Socket.hxx:162
int selectMilliSeconds(unsigned long ms)
Definition Socket.hxx:181
This is the primary point of interaction between the app-layer and the stack.
Definition SipStack.hxx:160
virtual void process(FdSet &fdset)
This allows the executive to give processing time to stack components.
virtual unsigned int getTimeTillNextProcessMS()
Returns time in milliseconds when process next needs to be called.
virtual void buildFdSet(FdSet &fdset)
Build the FD set to use in a select to find out when process(FdSet&) must be called again.
virtual unsigned int getTimeTillNextProcessMS() const
StackThread(SipStack &stack)
virtual void afterProcess()
virtual void beforeProcess()
virtual void buildFdSet(FdSet &fdset)
virtual void thread()
bool isShutdown() const
Definition ThreadIf.cxx:212
dcm! – add UnusedChecking(_enum) below;
const _Tp & resipMin(const _Tp &__a, const _Tp &__b)
Definition compat.hxx:182