add shutdown packet and flow report

This commit is contained in:
xiongguangjie
2022-06-03 21:17:01 +08:00
parent b9f66ca1ec
commit 82da99eef3
5 changed files with 56 additions and 3 deletions

View File

@@ -9,6 +9,18 @@ SrtTransportImp::SrtTransportImp(const EventPoller::Ptr &poller)
SrtTransportImp::~SrtTransportImp() {
InfoP(this);
uint64_t duration = _alive_ticker.createdTime() / 1000;
WarnP(this) << "srt 推流器("
<< _media_info._vhost << "/"
<< _media_info._app << "/"
<< _media_info._streamid
<< ")断开,耗时(s):" << duration;
//流量统计事件广播
GET_CONFIG(uint32_t, iFlowThreshold, General::kFlowThreshold);
if (_total_bytes >= iFlowThreshold * 1024) {
NoticeCenter::Instance().emitEvent(Broadcast::kBroadcastFlowReport, _media_info, _total_bytes, duration, false, static_cast<SockInfo &>(*this));
}
}
void SrtTransportImp::onHandShakeFinished(std::string &streamid,struct sockaddr_storage *addr) {