mirror of
https://github.com/ossrs/srs.git
synced 2025-02-13 11:51:57 +00:00
fast stop server.
This commit is contained in:
parent
3ab5892863
commit
1e4c8f8bf3
2 changed files with 8 additions and 14 deletions
|
@ -270,7 +270,9 @@ int SrsTcpListener::cycle()
|
|||
|
||||
if(client_stfd == NULL){
|
||||
// ignore error.
|
||||
srs_error("ignore accept thread stoppped for accept client error");
|
||||
if (errno != EINTR) {
|
||||
srs_error("ignore accept thread stoppped for accept client error");
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
srs_verbose("get a client. fd=%d", st_netfd_fileno(client_stfd));
|
||||
|
|
|
@ -566,25 +566,16 @@ void SrsServer::dispose()
|
|||
close_listeners(SrsListenerRtsp);
|
||||
close_listeners(SrsListenerFlv);
|
||||
|
||||
#ifdef SRS_AUTO_INGEST
|
||||
ingester->dispose();
|
||||
#endif
|
||||
// @remark don't dispose ingesters, for too slow.
|
||||
|
||||
#ifdef SRS_AUTO_KAFKA
|
||||
kafka->stop();
|
||||
#endif
|
||||
|
||||
// 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();
|
||||
|
@ -907,6 +898,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");
|
||||
|
|
Loading…
Reference in a new issue