Implement autostart functionality, ZIP packaging, and related installation scripts; update documentation and tests

This commit is contained in:
2026-09-09 18:27:32 +03:00
parent 49d10a5242
commit 369c0347a7
18 changed files with 368 additions and 13 deletions
+5
View File
@@ -11,6 +11,7 @@ internal sealed class MdnsPublisher(string fingerprint, int port) : IDisposable
private ServiceProfile? profile;
private string addressesKey = "";
private DateTimeOffset nextAnnouncement;
private DateTimeOffset lastRefresh;
public string Status { get; private set; } = "mDNS: ожидание локальной сети.";
public static ServiceProfile CreateProfile(string fingerprint, int port, IPAddress[] addresses)
@@ -28,6 +29,10 @@ internal sealed class MdnsPublisher(string fingerprint, int port) : IDisposable
{
try
{
// Rebind after a long pause (sleep/resume), even if Windows kept the same IP.
var now = DateTimeOffset.UtcNow;
if (lastRefresh != default && (now - lastRefresh > TimeSpan.FromSeconds(20) || now < lastRefresh)) Stop();
lastRefresh = now;
var key = string.Join(",", addresses.Select(a => a.ToString()));
if (discovery is null || key != addressesKey)
{