public static IPHostEntry EndResolve(IAsyncResult asyncResult)
{
if (NetEventSource.IsEnabled) NetEventSource.Enter(null, asyncResult);
IPHostEntry ipHostEntry;
try
{
ipHostEntry = HostResolutionEndHelper(asyncResult);
}
catch (SocketException ex)
{
IPAddress address = ((ResolveAsyncResult)asyncResult).address;
if (address == null)
throw; // BeginResolve was called with a HostName, not an IPAddress
if (NetEventSource.IsEnabled) NetEventSource.Error(null, ex);
ipHostEntry = NameResolutionUtilities.GetUnresolvedAnswer(address);
}
if (NetEventSource.IsEnabled) NetEventSource.Exit(null, ipHostEntry);
return ipHostEntry;
} // EndResolve()