From 5b8878c153fa08e7d734e71c49f37730d6e75a33 Mon Sep 17 00:00:00 2001 From: EAimTY Date: Sun, 5 Feb 2023 19:04:47 +0900 Subject: [PATCH] fix client heartbeat condition --- tuic-client/src/connection.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tuic-client/src/connection.rs b/tuic-client/src/connection.rs index 50d72af..16296ad 100644 --- a/tuic-client/src/connection.rs +++ b/tuic-client/src/connection.rs @@ -393,7 +393,9 @@ impl Connection { loop { time::sleep(heartbeat).await; - if self.is_closed() { + let task_count = self.model.task_connect_count() + self.model.task_associate_count(); + + if self.is_closed() || task_count == 0 { break; }