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

fast stop server.

This commit is contained in:
winlin 2015-12-11 10:30:13 +08:00
parent 2830ee12c1
commit 5660e24953
2 changed files with 8 additions and 14 deletions

View file

@ -553,22 +553,13 @@ void SrsServer::dispose()
close_listeners(SrsListenerRtsp);
close_listeners(SrsListenerFlv);
#ifdef SRS_AUTO_INGEST
ingester->dispose();
#endif
// @remark don't dispose ingesters, for too slow.
// dispose the source for hls and dvr.
SrsSource::dispose_all();
while (!conns.empty()) {
std::vector<SrsConnection*>::iterator it;
for (it = conns.begin(); it != conns.end(); ++it) {
SrsConnection* conn = *it;
conn->dispose();
}
st_usleep(100 * 1000);
}
// @remark don't dispose all connections, for too slow.
#ifdef SRS_AUTO_MEM_WATCH
srs_memory_report();
#endif
@ -871,6 +862,7 @@ int SrsServer::cycle()
st_usleep(3 * 1000 * 1000);
srs_warn("system quit");
#else
// normally quit with neccessary cleanup by dispose().
srs_warn("main cycle terminated, system quit normally.");
dispose();
srs_trace("srs terminated");