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

◆ GetHostEntryAsync() [3/4]

static Task< IPHostEntry > System.Net.Dns.GetHostEntryAsync ( string hostNameOrAddress,
AddressFamily family,
CancellationToken cancellationToken = default(CancellationToken) )
inlinestatic

Definition at line 103 of file Dns.cs.

104 {
105 if (System.Net.NetEventSource.Log.IsEnabled())
106 {
108 hostEntryCoreAsync.ContinueWith(delegate(Task<IPHostEntry> t, object s)
109 {
110 string text = (string)s;
111 if (t.Status == TaskStatus.RanToCompletion)
112 {
113 System.Net.NetEventSource.Info(text, $"{t.Result} with {t.Result.AddressList.Length} entries", "GetHostEntryAsync");
114 }
115 Exception ex = t.Exception?.InnerException;
117 {
118 System.Net.NetEventSource.Error(text, $"{text} DNS lookup failed with {((ExternalException)(object)ex2).ErrorCode}", "GetHostEntryAsync");
119 }
120 else if (ex is OperationCanceledException)
121 {
122 System.Net.NetEventSource.Error(text, $"{text} DNS lookup was canceled", "GetHostEntryAsync");
123 }
125 return hostEntryCoreAsync;
126 }
128 }
static Task< IPHostEntry > GetHostEntryCoreAsync(string hostName, bool justReturnParsedIp, bool throwOnIIPAny, AddressFamily family, CancellationToken cancellationToken)
Definition Dns.cs:467
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.cancellationToken, System.Threading.Tasks.TaskScheduler.Default, System.Net.NetEventSource.Error(), System.Net.Dns.GetHostEntryCoreAsync(), System.Net.NetEventSource.Info(), System.Net.NetEventSource.Log, System.Threading.CancellationToken.None, System.s, and System.text.