Windows 0.3.4 connection resilience and fixed-grid source delta; no private history or other platform changes

This commit is contained in:
2026-11-05 03:41:46 +00:00
parent aff1a50d35
commit 991b029b37
25 changed files with 629 additions and 96 deletions
+29
View File
@@ -0,0 +1,29 @@
namespace UCVL.VPNPlus;
// A bounded round tolerates isolated ICMP loss. This is address reachability,
// never a substitute for an authenticated proxy grant or a business-site test.
internal static class TailnetPingConfirmation
{
internal const int Attempts = 3;
internal static async Task<bool> ProbeAsync(Func<CancellationToken, Task<bool>> ping,
CancellationToken token, TimeSpan? budget = null)
{
token.ThrowIfCancellationRequested();
using var deadline = CancellationTokenSource.CreateLinkedTokenSource(token);
deadline.CancelAfter(budget ?? TimeSpan.FromSeconds(4));
for (var attempt = 0; attempt < Attempts; attempt++)
{
try
{
var reachable = await ping(deadline.Token).WaitAsync(deadline.Token).ConfigureAwait(false);
token.ThrowIfCancellationRequested();
if (reachable) return true;
}
catch (OperationCanceledException) when (!token.IsCancellationRequested && deadline.IsCancellationRequested) { return false; }
catch (OperationCanceledException) { throw; }
catch (Exception) { /* One failed ICMP attempt is inconclusive. */ }
token.ThrowIfCancellationRequested();
}
return false;
}
}