Пример #1
0
 /// <summary>
 /// Resolve address to host or return address as
 /// string of resolve fails
 /// </summary>
 /// <param name="address"></param>
 /// <returns></returns>
 public static async Task <string> TryResolveAsync(this IPAddress address)
 {
     if (address == null)
     {
         return(null);
     }
     try {
         return(await address.ResolveAsync());
     }
     catch {
         return(address.ToString());
     }
 }