Skip to content

Commit 7afba16

Browse files
committed
Cleanup, dns lookup fixed when error is thrown
1 parent 009cb94 commit 7afba16

File tree

2 files changed

+17
-19
lines changed

2 files changed

+17
-19
lines changed

Source/NETworkManager/Models/Network/DNSLookup.cs

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -99,18 +99,25 @@ public void ResolveAsync(List<string> hosts)
9999
dnsLookupClient.Timeout = Timeout;
100100
dnsLookupClient.Retries = Retries;
101101

102-
// PTR vs A, AAAA, CNAME etc.
103-
var dnsResponse = QueryType == QueryType.PTR ? dnsLookupClient.QueryReverse(IPAddress.Parse(host)) : dnsLookupClient.Query(host, QueryType, QueryClass);
104-
105-
// If there was an error... return
106-
if (dnsResponse.HasError)
102+
try
107103
{
108-
OnLookupError(new DNSLookupErrorArgs(dnsResponse.ErrorMessage, dnsResponse.NameServer.Endpoint));
109-
return;
104+
// PTR vs A, AAAA, CNAME etc.
105+
var dnsResponse = QueryType == QueryType.PTR ? dnsLookupClient.QueryReverse(IPAddress.Parse(host)) : dnsLookupClient.Query(host, QueryType, QueryClass);
106+
107+
// If there was an error... return
108+
if (dnsResponse.HasError)
109+
{
110+
OnLookupError(new DNSLookupErrorArgs(dnsResponse.ErrorMessage, dnsResponse.NameServer.Endpoint));
111+
return;
112+
}
113+
114+
// Process the results...
115+
ProcessDnsQueryResponse(dnsResponse);
116+
}
117+
catch(Exception ex)
118+
{
119+
OnLookupError(new DNSLookupErrorArgs(ex.Message, dnsServer));
110120
}
111-
112-
// Process the results...
113-
ProcessDnsQueryResponse(dnsResponse);
114121
});
115122
}
116123

Source/NETworkManager/app.manifest

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,6 @@
1212

1313
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
1414
<application>
15-
<!-- Windows 7 - Dropped support with version 2.0 -->
16-
<!-- <supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}" /> -->
17-
18-
<!-- Windows 8 - Dropped support with version 2.0 -->
19-
<!-- <supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}" /> -->
20-
21-
<!-- Windows 8.1 - Dropped support with version 2.0 -->
22-
<!-- <supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}" /> -->
23-
2415
<!-- Windows 10 -->
2516
<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}" />
2617
</application>

0 commit comments

Comments
 (0)