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

For #906, #902, use connection manager to remove connection

This commit is contained in:
winlin 2017-05-29 18:34:41 +08:00
parent 44f542f77f
commit 3ffb0980f5
6 changed files with 108 additions and 9 deletions

View file

@ -50,6 +50,7 @@ using namespace std;
#include <srs_core_mem_watch.hpp>
#include <srs_kernel_consts.hpp>
#include <srs_app_kafka.hpp>
#include <srs_app_thread.hpp>
// system interval in ms,
// all resolution times should be times togother,
@ -483,6 +484,7 @@ SrsServer::SrsServer()
pid_fd = -1;
signal_manager = NULL;
conn_manager = new SrsCoroutineManager();
handler = NULL;
ppid = ::getppid();
@ -524,6 +526,7 @@ void SrsServer::destroy()
}
srs_freep(signal_manager);
srs_freep(conn_manager);
}
void SrsServer::dispose()
@ -742,6 +745,10 @@ int SrsServer::listen()
return ret;
}
if ((ret = conn_manager->start()) != ERROR_SUCCESS) {
return ret;
}
return ret;
}
@ -1334,7 +1341,7 @@ void SrsServer::remove(ISrsConnection* c)
// all connections are created by server,
// so we free it here.
srs_freep(conn);
conn_manager->remove(c);
}
int SrsServer::on_reload_listen()