⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 sipretransmitmanager.h

📁 一个SIP协议栈
💻 H
字号:
#ifndef __SIPRETRANSMITMANAGER_H__#define __SIPRETRANSMITMANAGER_H__#include "SIPTimer.h"#include "IPAddress.h"#include "UDPSocket.h"#include "SIPTimer.h"namespace msip{    ///Retransmit Manager via UDP     class RetransmitManager    {    public:        ///Current State        enum Status        {            trIdle,            trPending,            trTransmitIndicated,            trTimeoutReached        };    private:        ///Timer1 0.5s, 1.0s, 2.0s, 4.0s        Timer  tr_Timer1;        ///Timer2 4.0s        Timer  tr_Timer2;        ///Current Interval in milliseconds        double tr_Interval;         ///Current State        Status tr_Status;        ///Timer1 Value T1 (0.5s)        long   tr_T1;        ///Timer2 Value T2 (4.0s)        long   tr_T2;        ///Exponetial Value (2.0)        double tr_Exp;    public:        ///Constructor        RetransmitManager(long t1=500, long t2=4000, double exp_val=2.0);        ///Set the timeout values and the exponent value        void setTimeoutValues(long t1=500, long t2=4000, double exp_val=2.0);        ///Start timers        void   start();        ///Cancel retransmittion        void   cancel();        ///Poll timers and return status.        Status poll();        ///Returns the time in milliseconds that left to the nearest retransmittion        long   getTimeLeft() const;        /**Get Current Status. Note, that the function will never return            the status trTransmitIndicated. Only the function "poll" will            return this status when retransmittion is necessary. */        Status getStatus() { return tr_Status; }    };}#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -