Commit f71a32bc by xiongziliang Committed by GitHub

测试用例

测试用例
parent f21a367d
//============================================================================
// Name : main.cpp
// Author : 熊子良
// Version :
//============================================================================
#include <signal.h>
#include <unistd.h>
#include <iostream>
#include "Util/SqlPool.h"
#include "Util/logger.h"
#include "Util/onceToken.h"
#include "Rtsp/UDPServer.h"
#include "Rtsp/RtspSession.h"
#include "Rtmp/RtmpSession.h"
#include "Network/TcpServer.h"
#include "Poller/EventPoller.hpp"
#include "Thread/WorkThreadPool.h"
#include "Http/HttpSession.h"
using namespace std;
using namespace ZL::Util;
using namespace ZL::Http;
using namespace ZL::Rtsp;
using namespace ZL::Rtmp;
using namespace ZL::Thread;
using namespace ZL::Network;
void programExit(int arg) {
EventPoller::Instance().shutdown();
}
int main(int argc,char *argv[]){
signal(SIGINT, programExit);
Logger::Instance().add(std::make_shared<ConsoleChannel>("stdout", LTrace));
Logger::Instance().setWriter(std::make_shared<AsyncLogWriter>());
TcpServer<RtspSession>::Ptr rtspSrv(new TcpServer<RtspSession>());
TcpServer<RtmpSession>::Ptr rtmpSrv(new TcpServer<RtmpSession>());
TcpServer<HttpSession>::Ptr httpSrv(new TcpServer<HttpSession>());
rtspSrv->start(mINI::Instance()[Config::Rtsp::kPort]);
rtmpSrv->start(mINI::Instance()[Config::Rtmp::kPort]);
httpSrv->start(mINI::Instance()[Config::Http::kPort]);
EventPoller::Instance().runLoop();
rtspSrv.reset();
rtmpSrv.reset();
httpSrv.reset();
static onceToken token(nullptr, []() {
UDPServer::Destory();
WorkThreadPool::Destory();
EventPoller::Destory();
Logger::Destory();
});
return 0;
}
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论