mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
Use SrsAsyncCallWorker in http hooks instead, to covert to async call. (#2542)
* Use SrsAsyncCallWorker in http hooks instead, to covert to async call. * delete invalid function
This commit is contained in:
parent
c8bf98e8e2
commit
c4a64ee470
4 changed files with 162 additions and 86 deletions
|
@ -243,6 +243,7 @@ SrsRtcServer::SrsRtcServer()
|
|||
{
|
||||
handler = NULL;
|
||||
hijacker = NULL;
|
||||
async = new SrsAsyncCallWorker();
|
||||
|
||||
_srs_config->subscribe(this);
|
||||
}
|
||||
|
@ -258,6 +259,9 @@ SrsRtcServer::~SrsRtcServer()
|
|||
srs_freep(listener);
|
||||
}
|
||||
}
|
||||
|
||||
async->stop();
|
||||
srs_freep(async);
|
||||
}
|
||||
|
||||
srs_error_t SrsRtcServer::initialize()
|
||||
|
@ -273,6 +277,8 @@ srs_error_t SrsRtcServer::initialize()
|
|||
return srs_error_wrap(err, "black hole");
|
||||
}
|
||||
|
||||
async->start();
|
||||
|
||||
return err;
|
||||
}
|
||||
|
||||
|
@ -289,6 +295,11 @@ void SrsRtcServer::set_handler(ISrsRtcServerHandler* h)
|
|||
void SrsRtcServer::set_hijacker(ISrsRtcServerHijacker* h)
|
||||
{
|
||||
hijacker = h;
|
||||
}
|
||||
|
||||
srs_error_t SrsRtcServer::exec_async_work(ISrsAsyncCallTask * t)
|
||||
{
|
||||
return async->execute(t);
|
||||
}
|
||||
|
||||
srs_error_t SrsRtcServer::listen_udp()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue