Vocal学习

本文从VocalsipbaseBaseProxyTestMain.cxx入手,介绍了如何通过创建Builder和HeartlessProxy对象来运行Vocal程序。文章详细解释了Builder类的作用及其如何与HeartlessProxy对象交互,并说明了SipThread和WorkerThread的工作原理。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

 VocalsipbaseBaseProxyTestMain.cxx入手开始学习Vocal程序。
 It is specified as a test program in the Makefile.
 
It creates Builder and HeartlessProxy objects and then runs the proxy object. SIP messages can then be sent to the Proxy IP address:port and will be passed to the Proxy Builder. After that, it is up the designer to add his/her message processing code.

 首先建立了Builder对象。
 
Builder is a base class. It is passed Events by the WorkerThread. for processing. It is a Feature container. Feature is a State container.State is an Operator container. It also contains a pointer to the proxy CallContainer. A builder object is used in constructing a HeartLessProxy/BasicProxy object.

 /* C++ 的成员初始化表 , C++ Primer pg570 */
 class Account {
    ...
    inline Account ()
                  : _name(0), _balance(0.0), _acct_nmbr(0)
     {} //_name = 0, _balance = 0.0, _acct_nmbr = 0
    ...
}

然后以Builder对象等为参数建立HeartLessProxy对象,该对象的run方法启动以下两个类的thread方法:
 SipThread
SipThread is a ThreadIf. SipThread blocks on sipstack receive. On
receiving a SipMsg it creates a SipEvent. The SipEvent then gets posted
to fifo. The SipThread::thread() has the while loop.

WorkerThread
WorkerThread is a ThreadIf. It has a input queue on which it is blocked.
The input queue contains sip proxy events.

以上的总体工作就是新建两个线程,一个线程等待接收message,当收到的时候就建立event对象放
入到FIFO队列;另一个线程从该FIFO队列中取出事件进行处理。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值