Network Reconnection Delay
Nucleic-Session: 4BE3E40C-E939-444C-8AED-93C0AFE13C07 Co-authored-by: Nucleic <[email protected]>
This commit is contained in:
@@ -706,7 +706,10 @@ final class HostConnection {
|
|||||||
}
|
}
|
||||||
revalidateTask?.cancel()
|
revalidateTask?.cancel()
|
||||||
revalidateTask = Task { [weak self] in
|
revalidateTask = Task { [weak self] in
|
||||||
let alive = await client.probeAlive(within: .milliseconds(800))
|
// A generous bound on a pong round-trip (LAN <10ms, relay <200ms) — only paid in full
|
||||||
|
// when the link is actually dead; a live one answers and exits in ~1 RTT. Kept well
|
||||||
|
// under the follow-on re-dial so the whole dead-link reconnect stays sub-second.
|
||||||
|
let alive = await client.probeAlive(within: .milliseconds(600))
|
||||||
guard !Task.isCancelled, let self, self.client === client,
|
guard !Task.isCancelled, let self, self.client === client,
|
||||||
self.connectivity.isLive else { return }
|
self.connectivity.isLive else { return }
|
||||||
if !alive {
|
if !alive {
|
||||||
|
|||||||
Reference in New Issue
Block a user