From c546a055a262d845cdc201345c71dc18fef86231 Mon Sep 17 00:00:00 2001 From: Andreas Venizelou Date: Thu, 8 Aug 2024 12:09:30 +0300 Subject: [PATCH] mDNS, cleanup --- Protest/Protocols/Mdns.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Protest/Protocols/Mdns.cs b/Protest/Protocols/Mdns.cs index f28946f8..45511876 100644 --- a/Protest/Protocols/Mdns.cs +++ b/Protest/Protocols/Mdns.cs @@ -100,6 +100,9 @@ public static byte[] Resolve(string queryString, int timeout = 2000, RecordType byte[] reply = new byte[1024]; try { + //EndPoint remoteEP = new IPEndPoint(IPAddress.Any, 0); + //int length = socket.ReceiveFrom(reply, ref remoteEP); + int length = socket.Receive(reply); if (length > 0) { byte[] actualReply = new byte[length]; @@ -246,7 +249,7 @@ private static Answer[] DeconstructResponse( Answer ans = new Answer(); int nameStartIndex = index; - + if ((response[index] & 0xC0) == 0xC0) { index += 2; } @@ -277,7 +280,7 @@ private static Answer[] DeconstructResponse( index += 2; //skip preference } - if (ans.length > response.Length - index ) { + if (ans.length > response.Length - index) { ans.error = 254; break; }