From 040d182547df9a5f8a233dcaeba2f2c5d745b734 Mon Sep 17 00:00:00 2001 From: Santiago Lo Coco Date: Mon, 4 Nov 2024 19:39:28 +0100 Subject: [PATCH] Skip mdns unregister packages --- Assets/Scripts/ServiceDiscovery.cs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Assets/Scripts/ServiceDiscovery.cs b/Assets/Scripts/ServiceDiscovery.cs index 0a8b7bb..c7141cd 100644 --- a/Assets/Scripts/ServiceDiscovery.cs +++ b/Assets/Scripts/ServiceDiscovery.cs @@ -227,6 +227,13 @@ public class ServiceDiscovery : MonoBehaviour ushort dataLength = (ushort)IPAddress.NetworkToHostOrder(BitConverter.ToInt16(data, offset + 8)); offset += 10; + if (ttl == 0) + { + Debug.LogWarning($"Zero TTL for {name}"); + // TODO: Remove service from list + return offset + dataLength; + } + if (recordType == 1) // A Record { IPAddress ipAddress = new IPAddress(new ArraySegment(data, offset, dataLength).ToArray());