From c7191023cbbe647e43914a58a8ad09aa20af999a Mon Sep 17 00:00:00 2001 From: rustdesk Date: Wed, 16 Feb 2022 20:12:33 +0800 Subject: [PATCH] test_nat_type sleep time --- src/common.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/common.rs b/src/common.rs index 16da93b7c..ca62b6d2e 100644 --- a/src/common.rs +++ b/src/common.rs @@ -211,6 +211,7 @@ pub fn resample_channels( } pub fn test_nat_type() { + let mut i = 0; std::thread::spawn(move || loop { match test_nat_type_() { Ok(true) => break, @@ -222,7 +223,11 @@ pub fn test_nat_type() { if Config::get_nat_type() != 0 { break; } - std::thread::sleep(std::time::Duration::from_secs(12)); + i = i * 2 + 1; + if i > 300 { + i = 300; + } + std::thread::sleep(std::time::Duration::from_secs(i)); }); }