Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ GetHostEntryAsync() [1/4]

static Task< IPHostEntry > System.Net.Dns.GetHostEntryAsync ( IPAddress address)
inlinestatic

Definition at line 130 of file Dns.cs.

131 {
132 if (address == null)
133 {
134 throw new ArgumentNullException("address");
135 }
136 if (address.Equals(IPAddress.Any) || address.Equals(IPAddress.IPv6Any))
137 {
138 if (System.Net.NetEventSource.Log.IsEnabled())
139 {
140 System.Net.NetEventSource.Error(address, $"Invalid address '{address}'", "GetHostEntryAsync");
141 }
142 throw new ArgumentException(System.SR.net_invalid_ip_addr, "address");
143 }
145 {
146 IPHostEntry hostEntryCore = GetHostEntryCore((IPAddress)s, AddressFamily.Unspecified, stopwatch);
147 if (System.Net.NetEventSource.Log.IsEnabled())
148 {
149 System.Net.NetEventSource.Info((IPAddress)s, $"{hostEntryCore} with {hostEntryCore.AddressList.Length} entries", "GetHostEntryAsync");
150 }
151 return hostEntryCore;
152 }, address, CancellationToken.None);
153 }
static IPHostEntry GetHostEntryCore(string hostName, AddressFamily addressFamily, ValueStopwatch stopwatch=default(ValueStopwatch))
Definition Dns.cs:357
static readonly System.Net.NetEventSource Log
static void Info(object thisOrContextObject, FormattableString formattableString=null, [CallerMemberName] string memberName=null)
static void Error(object thisOrContextObject, FormattableString formattableString, [CallerMemberName] string memberName=null)
static string net_invalid_ip_addr
Definition SR.cs:16
Definition SR.cs:7

References System.Net.IPAddress.Any, System.Net.IPAddress.Equals(), System.Net.NetEventSource.Error(), System.Net.Dns.GetHostEntryCore(), System.Net.NetEventSource.Info(), System.Net.IPAddress.IPv6Any, System.Net.NetEventSource.Log, System.SR.net_invalid_ip_addr, System.Threading.CancellationToken.None, and System.s.