提交 1c5414b2 authored 作者: blu's avatar blu

init

上级 25a3ad0e
...@@ -215,14 +215,15 @@ private: ...@@ -215,14 +215,15 @@ private:
} }
//ping //ping
ret = ping(); ret = ping();
thPing = thread([&,this]() { // TODO: don't need this anymore, since I've used the draft feature of ZOUTER_NOTIFICATION instead
while(true) { // thPing = thread([&,this]() {
this_thread::sleep_for(chrono::seconds(EV_HEARTBEAT_SECONDS-2)); // while(true) {
ping(); // this_thread::sleep_for(chrono::seconds(EV_HEARTBEAT_SECONDS-2));
} // ping();
}); // }
// });
thPing.detach();
// thPing.detach();
return ret; return ret;
} }
......
...@@ -53,7 +53,6 @@ private: ...@@ -53,7 +53,6 @@ private:
ret = z_send_multiple(pDealer, body); ret = z_send_multiple(pDealer, body);
if(ret < 0) { if(ret < 0) {
spdlog::error("evpuller {} {} failed to send multiple: {}", devSn, iid, zmq_strerror(zmq_errno())); spdlog::error("evpuller {} {} failed to send multiple: {}", devSn, iid, zmq_strerror(zmq_errno()));
} }
return ret; return ret;
} }
...@@ -95,14 +94,16 @@ protected: ...@@ -95,14 +94,16 @@ protected:
// declare ready to router // declare ready to router
ping(); ping();
thPing = thread([&,this]() { // TODO: don't need this anymore, since I've used the draft feature of ZOUTER_NOTIFICATION instead
while(true) { // thPing = thread([&,this]() {
this_thread::sleep_for(chrono::seconds(EV_HEARTBEAT_SECONDS-2)); // while(true) {
ping(); // this_thread::sleep_for(chrono::seconds(EV_HEARTBEAT_SECONDS-2));
} // ping();
}); // }
// });
thPing.detach(); // thPing.detach();
// init response msg // init response msg
while (true) { while (true) {
if(checkStop() == true) { if(checkStop() == true) {
......
...@@ -164,14 +164,15 @@ private: ...@@ -164,14 +164,15 @@ private:
} }
//ping //ping
ret = ping(); ret = ping();
thPing = thread([&,this]() { // TODO: don't need this anymore, since I've used the draft feature of ZOUTER_NOTIFICATION instead
while(true) { // thPing = thread([&,this]() {
this_thread::sleep_for(chrono::seconds(EV_HEARTBEAT_SECONDS-2)); // while(true) {
ping(); // this_thread::sleep_for(chrono::seconds(EV_HEARTBEAT_SECONDS-2));
} // ping();
}); // }
// });
thPing.detach();
// thPing.detach();
return ret; return ret;
} }
......
...@@ -207,14 +207,15 @@ private: ...@@ -207,14 +207,15 @@ private:
} }
//ping //ping
ret = ping(); ret = ping();
thPing = thread([&,this]() { // TODO: don't need this anymore, since I've used the draft feature of ZOUTER_NOTIFICATION instead
while(true) { // thPing = thread([&,this]() {
this_thread::sleep_for(chrono::seconds(EV_HEARTBEAT_SECONDS-2)); // while(true) {
ping(); // this_thread::sleep_for(chrono::seconds(EV_HEARTBEAT_SECONDS-2));
} // ping();
}); // }
// });
thPing.detach();
// thPing.detach();
return ret; return ret;
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论