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

@@ -177,6 +177,16 @@ bool RtpProcess::alive() {
return false;
}
void RtpProcess::onDetach(){
if(_on_detach){
_on_detach();
}
}
void RtpProcess::setOnDetach(const function<void()> &cb) {
_on_detach = cb;
}
string RtpProcess::get_peer_ip() {
if(_addr){
return SockUtil::inet_ntoa(((struct sockaddr_in *) _addr)->sin_addr);