Skip to content

Commit 01b5177

Browse files
committed
feat(mqtt): 1.12.27, 修改example/mqtt/conn,使用采用2次退避重连策略
1 parent e951fba commit 01b5177

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

examples/mqtt/conn/conn.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,9 @@ int main(int argc, char **argv)
4343
mqtt::Client::Config conf;
4444
conf.auto_reconnect_enable = true;
4545
//conf.auto_reconnect_wait_sec = 5;
46-
conf.auto_reconnect_wait_sec_gen_func = [](int fail_count) { return 1 << fail_count; };
46+
conf.auto_reconnect_wait_sec_gen_func = [](int fail_count) {
47+
return 1 << std::min(fail_count, 4);
48+
};
4749
#if 0
4850
conf.base.broker.domain = "cppmain.cpp";
4951
conf.base.broker.port = 1883;

version.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,4 @@
2121
# TBOX版本号
2222
TBOX_VERSION_MAJOR := 1
2323
TBOX_VERSION_MINOR := 12
24-
TBOX_VERSION_REVISION := 26
24+
TBOX_VERSION_REVISION := 27

0 commit comments

Comments
 (0)