C#|C# .net core GetHostAddresses更新为GetHostAddressesAsync

为什么80%的码农都做不了架构师?>>>C#|C# .net core GetHostAddresses更新为GetHostAddressesAsync
文章图片

GitHub上的说明
【C#|C# .net core GetHostAddresses更新为GetHostAddressesAsync】代码:

var candidates = new List(); //IPAddress[] nodeIps = Dns.GetHostAddresses(addrOrHost); //结果与原来保持一致 IPAddress[] nodeIps = Dns.GetHostAddressesAsync(addrOrHost).GetAwaiter().GetResult();

转载于:https://my.oschina.net/idoop/blog/911741

    推荐阅读