1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-03-09 15:49:59 +00:00

Refactor code, add stop for hybrid server to do cleanup.

This commit is contained in:
winlin 2020-01-23 21:16:34 +08:00
parent db5788b205
commit 7c9b31815f
5 changed files with 38 additions and 0 deletions

View file

@ -211,6 +211,9 @@ SrtServerAdapter::~SrtServerAdapter()
srs_error_t SrtServerAdapter::initialize()
{
srs_error_t err = srs_success;
// TODO: FIXME: We could fork processes here, because here only ST is initialized.
return err;
}
@ -218,6 +221,8 @@ srs_error_t SrtServerAdapter::run()
{
srs_error_t err = srs_success;
// TODO: FIXME: We could start a coroutine to dispatch SRT task to processes.
if(_srs_config->get_srt_enabled()) {
srs_trace("srt server is enabled...");
unsigned short srt_port = _srs_config->get_srt_listen_port();
@ -242,3 +247,8 @@ srs_error_t SrtServerAdapter::run()
return err;
}
void SrtServerAdapter::stop()
{
// TODO: FIXME: If forked processes, we should do cleanup.
}

View file

@ -47,6 +47,7 @@ public:
public:
virtual srs_error_t initialize();
virtual srs_error_t run();
virtual void stop();
};
#endif//SRT_SERVER_H