reSIProcate
SIP stack, Dialog Usage Manager and related libraries
Loading...
Searching...
No Matches
TuSelector.hxx
Go to the documentation of this file.
1#if !defined(RESIP_TuSelector_HXX)
2#define RESIP_TuSelector_HXX
3
8#include "rutil/Fifo.hxx"
9
10namespace resip
11{
12
13class ConnectionTerminated;
14class KeepAlivePong;
15class Message;
16class TransactionUser;
17class AsyncProcessHandler;
18
20{
21 public:
24
26 void add(ConnectionTerminated* term);
27 void add(KeepAlivePong* pong);
28
29 unsigned int size() const;
31
33 bool haveTransactionUsers() const { return mTuSelectorMode; }
34 void registerTransactionUser(TransactionUser&, const bool front = false);
37 void process();
38 unsigned int getTimeTillNextProcessMS();
40
41 // Handler is notified when a message is posted
42 // to the default application receive queue.
44
48
49 private:
50 void remove(TransactionUser* tu);
51 void markShuttingDown(TransactionUser* tu);
52 bool exists(TransactionUser* tu);
53
54 private:
55 struct Item
56 {
57 Item(TransactionUser* ptu) : tu(ptu), shuttingDown(false) {}
58 TransactionUser* tu;
59 bool shuttingDown;
60 bool operator==(const Item& rhs) { return tu == rhs.tu; }
61 };
62
63 typedef std::vector<Item> TuList;
64 TuList mTuList;
65 TimeLimitFifo<Message>& mFallBackFifo;
66 CongestionManager* mCongestionManager;
67 AsyncProcessHandler *mFallbackPostNotify;
68 Fifo<TransactionUserMessage> mShutdownFifo;
69 bool mTuSelectorMode;
70 StatisticsMessage::Payload mStatsPayload;
71};
72}
73
74#endif
75
76/* ====================================================================
77 * The Vovida Software License, Version 1.0
78 *
79 * Copyright (c) 2000 Vovida Networks, Inc. All rights reserved.
80 *
81 * Redistribution and use in source and binary forms, with or without
82 * modification, are permitted provided that the following conditions
83 * are met:
84 *
85 * 1. Redistributions of source code must retain the above copyright
86 * notice, this list of conditions and the following disclaimer.
87 *
88 * 2. Redistributions in binary form must reproduce the above copyright
89 * notice, this list of conditions and the following disclaimer in
90 * the documentation and/or other materials provided with the
91 * distribution.
92 *
93 * 3. The names "VOCAL", "Vovida Open Communication Application Library",
94 * and "Vovida Open Communication Application Library (VOCAL)" must
95 * not be used to endorse or promote products derived from this
96 * software without prior written permission. For written
97 * permission, please contact vocal@vovida.org.
98 *
99 * 4. Products derived from this software may not be called "VOCAL", nor
100 * may "VOCAL" appear in their name, without prior written
101 * permission of Vovida Networks, Inc.
102 *
103 * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED
104 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
105 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND
106 * NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL VOVIDA
107 * NETWORKS, INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT DAMAGES
108 * IN EXCESS OF $1,000, NOR FOR ANY INDIRECT, INCIDENTAL, SPECIAL,
109 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
110 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
111 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
112 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
113 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
114 * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
115 * DAMAGE.
116 *
117 * ====================================================================
118 *
119 * This software consists of voluntary contributions made by Vovida
120 * Networks, Inc. and many individuals on behalf of Vovida Networks,
121 * Inc. For more information on Vovida Networks, Inc., please see
122 * <http://www.vovida.org/>.
123 *
124 */
static void usage(void)
Definition adig.c:755
Abstract base class that provides a basic congestion management interface.
The base-class used for message-passing.
Definition Message.hxx:21
Represents a SIP message.
The base-class for an RFC 3261 Transaction User.
TransactionUser * selectTransactionUser(const SipMessage &msg)
bool haveTransactionUsers() const
CongestionManager::RejectionBehavior getRejectionBehavior(TransactionUser *tu) const
void requestTransactionUserShutdown(TransactionUser &)
bool wouldAccept(TimeLimitFifo< Message >::DepthUsage usage) const
void add(Message *msg, TimeLimitFifo< Message >::DepthUsage usage)
uint32_t getExpectedWait(TransactionUser *tu) const
void setFallbackPostNotify(AsyncProcessHandler *handler)
unsigned int size() const
unsigned int getTimeTillNextProcessMS()
void setCongestionManager(CongestionManager *manager)
bool isTransactionUserStillRegistered(const TransactionUser *) const
void unregisterTransactionUser(TransactionUser &)
void registerTransactionUser(TransactionUser &, const bool front=false)
dcm! – add UnusedChecking(_enum) below;
unsigned int uint32_t
Definition Stun.hxx:34