http api新建的rtp服务器可以自动超时移除

This commit is contained in:
xiongziliang
2020-07-08 10:25:30 +08:00
parent e58a63c528
commit b2ff53037b
6 changed files with 47 additions and 2 deletions

View File

@@ -44,6 +44,16 @@ public:
*/
bool alive();
/**
* 超时时被RtpSelector移除时触发
*/
void onDetach();
/**
* 设置onDetach事件回调
*/
void setOnDetach(const function<void()> &cb);
/// SockInfo override
string get_local_ip() override;
uint16_t get_local_port() override;
@@ -79,6 +89,7 @@ private:
MediaInfo _media_info;
uint64_t _total_bytes = 0;
Socket::Ptr _sock;
function<void()> _on_detach;
};
}//namespace mediakit