From 232a08f11012fd749b68882140a8b9dc1a653363 Mon Sep 17 00:00:00 2001 From: Harry Ho Date: Wed, 17 Mar 2021 10:18:30 +0800 Subject: [PATCH] nal: Fix comments & styling --- src/nal.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/nal.rs b/src/nal.rs index 5648faf..798cd5f 100644 --- a/src/nal.rs +++ b/src/nal.rs @@ -194,7 +194,7 @@ where } } }; - + // Blocking connect // Loop to wait until the socket is staying established or closed, // or the connection attempt has timed out. let mut timeout_ms: u32 = 0; @@ -216,11 +216,13 @@ where return Ok(handle) } } + // Any TCP states other than CLOSED and ESTABLISHED are considered // "transient", so this function should keep waiting and let smoltcp poll // (e.g. for handling echo reqeust/reply) at the same time. timeout_ms += self.update()?; self.poll()?; + // Time out, and return the socket for re-connection in the future. if timeout_ms > self.connection_timeout_ms { // TODO: Return Err(), but would require changes in quartiq/minimq