Use Dns.GetHostEntryAsync.

I can't believe I missed this in the documentation.
This commit is contained in:
Pieter-Jan Briers
2019-05-11 16:10:57 +02:00
parent f954bcb3e8
commit 1fd6488362

View File

@@ -176,7 +176,7 @@ namespace Lidgren.Network
try
{
var entry = await Task.Factory.FromAsync(Dns.BeginGetHostEntry, Dns.EndGetHostEntry, ipOrHost, null);
var entry = await Dns.GetHostEntryAsync(ipOrHost);
return entry.AddressList;
}
catch (SocketException)