/// <summary> /// Resolve endpoint to host:port or return address:port as /// string if resolve fails /// </summary> /// <param name="endpoint"></param> /// <returns></returns> public static string TryResolve(this EndPoint endpoint) { if (endpoint == null) { return(null); } try { return(endpoint.Resolve()); } catch { return($"{endpoint.GetIPAddress()}:{endpoint.GetPort()}"); } }