提交 a7d3931a authored 作者: blu's avatar blu

nop

上级 44cf2efd
...@@ -105,6 +105,12 @@ void on_connlost(void *context, char *cause) ...@@ -105,6 +105,12 @@ void on_connlost(void *context, char *cause)
spdlog::error(msg); spdlog::error(msg);
//self->state.set_exception(StrException(msg)); //self->state.set_exception(StrException(msg));
sleepTime = cnt* kRetryIntervalMinSeconds; sleepTime = cnt* kRetryIntervalMinSeconds;
if(sleepTime > kRetryIntervalMaxSeconds) {
sleepTime = rand()%kRetryIntervalMaxSeconds;
if(sleepTime < kRetryIntervalMinSeconds){
sleepTime = kRetryIntervalMinSeconds;
}
}
this_thread::sleep_for(chrono::seconds(sleepTime)); this_thread::sleep_for(chrono::seconds(sleepTime));
sleepTime++; sleepTime++;
}else{ }else{
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论