mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2026-06-14 12:05:58 +08:00
更新ZLToolKit(解决可能丢失事件的问题)
This commit is contained in:
@@ -92,7 +92,9 @@ void rePushDelay(const string &app,const string &stream,const string &url){
|
||||
//这里才是真正执行main函数,你可以把函数名(domain)改成main,然后就可以输入自定义url了
|
||||
int domain(const string & filePath,const string & pushUrl){
|
||||
//设置退出信号处理函数
|
||||
signal(SIGINT, [](int){EventPollerPool::Instance().shutdown();});
|
||||
static semaphore sem;
|
||||
signal(SIGINT, [](int) { sem.post(); });// 设置退出信号
|
||||
|
||||
//设置日志
|
||||
Logger::Instance().add(std::make_shared<ConsoleChannel>());
|
||||
Logger::Instance().setWriter(std::make_shared<AsyncLogWriter>());
|
||||
@@ -103,8 +105,7 @@ int domain(const string & filePath,const string & pushUrl){
|
||||
//限制app为record是为了防止服务器上的文件被肆意访问
|
||||
createPusher(appName,filePath,pushUrl);
|
||||
|
||||
//开始事件轮询
|
||||
EventPollerPool::Instance().wait();
|
||||
sem.wait();
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user