Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
E
evsuits
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
OpsTeam
evsuits
Commits
f561a87f
提交
f561a87f
authored
12月 11, 2019
作者:
blu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
enhencement: timeout on receive configuration for daemon
上级
4c2aab6c
显示空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
21 行增加
和
6 行删除
+21
-6
evpuller.cpp
opencv-motion-detect/evpuller.cpp
+9
-0
zmqhelper.cpp
opencv-motion-detect/inc/zmqhelper.cpp
+12
-6
没有找到文件。
opencv-motion-detect/evpuller.cpp
浏览文件 @
f561a87f
...
@@ -464,6 +464,11 @@ public:
...
@@ -464,6 +464,11 @@ public:
drport
=
strEnv
;
drport
=
strEnv
;
}
}
strEnv
=
getenv
(
"LOGV"
);
if
(
strEnv
!=
nullptr
)
{
spdlog
::
set_level
(
spdlog
::
level
::
debug
);
}
strEnv
=
getenv
(
"PEERID"
);
strEnv
=
getenv
(
"PEERID"
);
if
(
strEnv
!=
nullptr
)
{
if
(
strEnv
!=
nullptr
)
{
selfId
=
strEnv
;
selfId
=
strEnv
;
...
@@ -490,12 +495,16 @@ public:
...
@@ -490,12 +495,16 @@ public:
spdlog
::
error
(
"evpuller {} failed to setup dealer {}"
,
selfId
,
addr
);
spdlog
::
error
(
"evpuller {} failed to setup dealer {}"
,
selfId
,
addr
);
exit
(
1
);
exit
(
1
);
}
}
spdlog
::
info
(
"evpuller {} setup dealer to daemon OK"
,
selfId
);
ret
=
zmqhelper
::
recvConfigMsg
(
pDaemon
,
config
,
addr
,
selfId
);
ret
=
zmqhelper
::
recvConfigMsg
(
pDaemon
,
config
,
addr
,
selfId
);
if
(
ret
!=
0
)
{
if
(
ret
!=
0
)
{
spdlog
::
error
(
"evpuller {} failed to receive configration message {}"
,
selfId
,
addr
);
spdlog
::
error
(
"evpuller {} failed to receive configration message {}"
,
selfId
,
addr
);
}
}
spdlog
::
info
(
"evpuller {} receive config from daemon OK"
,
selfId
);
init
();
init
();
spdlog
::
info
(
"evpuller {} init OK"
,
selfId
);
thEdgeMsgHandler
=
thread
([
this
]
{
thEdgeMsgHandler
=
thread
([
this
]
{
while
(
true
)
while
(
true
)
...
...
opencv-motion-detect/inc/zmqhelper.cpp
浏览文件 @
f561a87f
...
@@ -171,11 +171,17 @@ int setupDealer(void **ctx, void **s, string addr, string ident, int timeout) {
...
@@ -171,11 +171,17 @@ int setupDealer(void **ctx, void **s, string addr, string ident, int timeout) {
/// @return 0 success, otherwise failed.
/// @return 0 success, otherwise failed.
int
recvConfigMsg
(
void
*
s
,
json
&
config
,
string
addr
,
string
ident
){
int
recvConfigMsg
(
void
*
s
,
json
&
config
,
string
addr
,
string
ident
){
bool
bConfigGot
=
false
;
bool
bConfigGot
=
false
;
while
(
!
bConfigGot
){
auto
t
=
thread
([
&
](){
this_thread
::
sleep_for
(
chrono
::
seconds
(
5
));
if
(
bConfigGot
==
false
){
spdlog
::
error
(
"{} failed receive config from evdaemon"
,
ident
);
exit
(
1
);
}
});
auto
v
=
zmqhelper
::
z_recv_multiple
(
s
);
auto
v
=
zmqhelper
::
z_recv_multiple
(
s
);
if
(
v
.
size
()
!=
3
)
{
if
(
v
.
size
()
!=
3
)
{
spdlog
::
error
(
"{}
invalid msg from daemon: {}"
,
ident
,
addr
);
spdlog
::
error
(
"{}
received invalid msg from evdaemon"
,
ident
);
return
-
1
;
exit
(
1
)
;
}
}
spdlog
::
debug
(
"{} configuration msg received: {} {} {}"
,
ident
,
body2str
(
v
[
0
]),
body2str
(
v
[
1
]),
body2str
(
v
[
2
]));
spdlog
::
debug
(
"{} configuration msg received: {} {} {}"
,
ident
,
body2str
(
v
[
0
]),
body2str
(
v
[
1
]),
body2str
(
v
[
2
]));
...
@@ -188,11 +194,11 @@ int recvConfigMsg(void *s, json &config, string addr, string ident){
...
@@ -188,11 +194,11 @@ int recvConfigMsg(void *s, json &config, string addr, string ident){
bConfigGot
=
true
;
bConfigGot
=
true
;
}
catch
(
exception
&
e
)
{
}
catch
(
exception
&
e
)
{
spdlog
::
error
(
"{} invalid config msg from daemon {}, {}"
,
ident
,
addr
,
e
.
what
());
spdlog
::
error
(
"{} invalid config msg from daemon {}, {}"
,
ident
,
addr
,
e
.
what
());
return
-
1
;
}
}
}
return
0
;
t
.
join
();
return
bConfigGot
?
0
:
-
1
;
}
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论