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

◆ GetHostEntry() [1/3]

static IPHostEntry System.Net.Dns.GetHostEntry ( IPAddress address)
inlinestatic

Definition at line 36 of file Dns.cs.

37 {
38 if (address == null)
39 {
40 throw new ArgumentNullException("address");
41 }
42 if (address.Equals(IPAddress.Any) || address.Equals(IPAddress.IPv6Any))
43 {
44 if (System.Net.NetEventSource.Log.IsEnabled())
45 {
46 System.Net.NetEventSource.Error(address, $"Invalid address '{address}'", "GetHostEntry");
47 }
49 }
50 IPHostEntry hostEntryCore = GetHostEntryCore(address, AddressFamily.Unspecified);
51 if (System.Net.NetEventSource.Log.IsEnabled())
52 {
53 System.Net.NetEventSource.Info(address, $"{hostEntryCore} with {hostEntryCore.AddressList.Length} entries", "GetHostEntry");
54 }
55 return hostEntryCore;
56 }
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
static string Format(string resourceFormat, object p1)
Definition SR.cs:118
Definition SR.cs:7

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

Referenced by System.Net.ServiceNameStore.BuildServiceNames(), System.Net.Dns.GetHostEntry(), Terraria.Netplay.GetLocalIPAddress(), System.Net.WebProxy.IsLocal(), and Terraria.Netplay.SetRemoteIPOld().