【live555】RTSPServer反馈客户端数量的实时性

最近发现如果客户端退出,在一分钟左右的时间内仍然能够获取原来ServerMediaSession的Client数量。

在源代码中加入log,RTSPClientConnection在客户端退出时,及时地断开并销毁。

而ServerMediaSession的数量在RTSPClientSession销毁的时候才减为0。

在BasicTaskScheduler0::scheduleDelayedTask中,对加入DelayQueue中的AlarmHandler调试发现,当客户端退出,存在一个Delay值为65s的Entry。

然后通过全局搜索65,发现在创建RTSPServer时,有一个参数变量reclamationSeconds,默认值为65。
其注释如下:
      // If "reclamationSeconds" > 0, then the "RTSPClientSession" state for
      //     each client will get reclaimed (and the corresponding RTP stream(s)
      //     torn down) if no RTSP commands - or RTCP "RR" packets - from the
      //     client are received in at least "reclamationSeconds" seconds.

在创建RTSPServer时指定reclamationSeconds的值,将影响到RTSPClientSession的回收时间。 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值