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

◆ Resolve()

static IPHostEntry System.Net.Dns.Resolve ( string hostName)
inlinestatic

Definition at line 287 of file Dns.cs.

288 {
289 if (hostName == null)
290 {
291 throw new ArgumentNullException("hostName");
292 }
293 IPHostEntry iPHostEntry;
294 if (IPAddress.TryParse(hostName, out IPAddress address) && (address.AddressFamily != AddressFamily.InterNetworkV6 || SocketProtocolSupportPal.OSSupportsIPv6))
295 {
296 try
297 {
298 iPHostEntry = GetHostEntryCore(address, AddressFamily.Unspecified);
299 }
300 catch (SocketException message)
301 {
302 if (System.Net.NetEventSource.Log.IsEnabled())
303 {
304 System.Net.NetEventSource.Error(hostName, message, "Resolve");
305 }
307 }
308 }
309 else
310 {
311 iPHostEntry = GetHostEntryCore(hostName, AddressFamily.Unspecified);
312 }
313 if (System.Net.NetEventSource.Log.IsEnabled())
314 {
315 System.Net.NetEventSource.Info(hostName, iPHostEntry, "Resolve");
316 }
317 return iPHostEntry;
318 }
static IPHostEntry CreateHostEntryForAddress(IPAddress address)
Definition Dns.cs:582
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)

References System.Net.Dns.CreateHostEntryForAddress(), System.Net.NetEventSource.Error(), System.Net.Dns.GetHostEntryCore(), System.Net.NetEventSource.Info(), System.Net.NetEventSource.Log, System.Net.SocketProtocolSupportPal.OSSupportsIPv6, and System.Net.IPAddress.TryParse().