mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2024-11-26 04:31:37 +08:00
返回端口号
This commit is contained in:
parent
fe4da29fb1
commit
d9dea060d3
@ -79,38 +79,38 @@ API_EXPORT void API_CALL setGlobalOptionString(const char *key,const char *val){
|
||||
}
|
||||
mINI::Instance()[key] = val;
|
||||
}
|
||||
API_EXPORT int API_CALL initHttpServer(unsigned short port){
|
||||
API_EXPORT unsigned short API_CALL initHttpServer(unsigned short port){
|
||||
s_pHttpSrv.reset(new TcpServer());
|
||||
try {
|
||||
s_pHttpSrv->start<HttpSession>(port);
|
||||
return 0;
|
||||
return s_pHttpSrv->getPort();
|
||||
} catch (std::exception &ex) {
|
||||
s_pHttpSrv.reset();
|
||||
WarnL << ex.what();
|
||||
return -1;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
API_EXPORT int API_CALL initRtspServer(unsigned short port) {
|
||||
API_EXPORT unsigned short API_CALL initRtspServer(unsigned short port) {
|
||||
s_pRtspSrv.reset(new TcpServer());
|
||||
try {
|
||||
s_pRtspSrv->start<RtspSession>(port);
|
||||
return 0;
|
||||
return s_pRtspSrv->getPort();
|
||||
} catch (std::exception &ex) {
|
||||
s_pRtspSrv.reset();
|
||||
WarnL << ex.what();
|
||||
return -1;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
API_EXPORT int API_CALL initRtmpServer(unsigned short port) {
|
||||
API_EXPORT unsigned short API_CALL initRtmpServer(unsigned short port) {
|
||||
s_pRtmpSrv.reset(new TcpServer());
|
||||
try {
|
||||
s_pRtmpSrv->start<RtmpSession>(port);
|
||||
return 0;
|
||||
return s_pRtmpSrv->getPort();
|
||||
} catch (std::exception &ex) {
|
||||
s_pRtmpSrv.reset();
|
||||
WarnL << ex.what();
|
||||
return -1;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -56,24 +56,24 @@ API_EXPORT void API_CALL setGlobalOptionString(const char *key,const char *val);
|
||||
|
||||
/*
|
||||
* 描述:创建Http服务器
|
||||
* 参数:port:htt监听端口,推荐80
|
||||
* 返回值:0:成功;-1:失败
|
||||
* 参数:port:htt监听端口,推荐80,传入0则随机分配
|
||||
* 返回值:0:失败,非0:端口号
|
||||
*/
|
||||
API_EXPORT int API_CALL initHttpServer(unsigned short port);
|
||||
API_EXPORT unsigned short API_CALL initHttpServer(unsigned short port);
|
||||
|
||||
/*
|
||||
* 描述:创建RTSP服务器
|
||||
* 参数:port:rtsp监听端口,推荐554
|
||||
* 返回值:0:成功;-1:失败
|
||||
* 参数:port:rtsp监听端口,推荐554,传入0则随机分配
|
||||
* 返回值:0:失败,非0:端口号
|
||||
*/
|
||||
API_EXPORT int API_CALL initRtspServer(unsigned short port);
|
||||
API_EXPORT unsigned short API_CALL initRtspServer(unsigned short port);
|
||||
|
||||
/*
|
||||
* 描述:创建RTMP服务器
|
||||
* 参数:port:rtmp监听端口,推荐1935
|
||||
* 返回值:0:成功;-1:失败
|
||||
* 参数:port:rtmp监听端口,推荐1935,传入0则随机分配
|
||||
* 返回值:0:失败,非0:端口号
|
||||
*/
|
||||
API_EXPORT int API_CALL initRtmpServer(unsigned short port);
|
||||
API_EXPORT unsigned short API_CALL initRtmpServer(unsigned short port);
|
||||
|
||||
|
||||
/////////////////////////日志////////////////////////////////
|
||||
|
Loading…
Reference in New Issue
Block a user