/// <summary>Gets the host name of the local machine.</summary> public static string GetHostName() { NameResolutionPal.EnsureSocketsAreInitialized(); ValueStopwatch stopwatch = NameResolutionTelemetry.Log.BeforeResolution(string.Empty); string name; try { name = NameResolutionPal.GetHostName(); } catch when(LogFailure(stopwatch)) { Debug.Fail("LogFailure should return false"); throw; } if (NameResolutionTelemetry.Log.IsEnabled()) { NameResolutionTelemetry.Log.AfterResolution(stopwatch, successful: true); } if (NetEventSource.Log.IsEnabled()) { NetEventSource.Info(null, name); } return(name); }
} // InternalGetHostByAddress /***************************************************************************** * Function : gethostname * * Abstract: Queries the hostname from DNS * * Input Parameters: * * Returns: String ******************************************************************************/ /// <devdoc> /// <para>Gets the host name of the local machine.</para> /// </devdoc> public static string GetHostName() { if (GlobalLog.IsEnabled) { GlobalLog.Print("Dns.GetHostName"); } return(NameResolutionPal.GetHostName()); }
/// <summary>Gets the host name of the local machine.</summary> public static string GetHostName() { if (NetEventSource.IsEnabled) { NetEventSource.Info(null, null); } NameResolutionPal.EnsureSocketsAreInitialized(); return(NameResolutionPal.GetHostName()); }
} // InternalGetHostByAddress /***************************************************************************** * Function : gethostname * * Abstract: Queries the hostname from DNS * * Input Parameters: * * Returns: String ******************************************************************************/ /// <devdoc> /// <para>Gets the host name of the local machine.</para> /// </devdoc> public static string GetHostName() { if (GlobalLog.IsEnabled) { GlobalLog.Print("Dns.GetHostName"); } NameResolutionPal.EnsureSocketsAreInitialized(); return(NameResolutionPal.GetHostName()); }
/// <summary>Gets the host name of the local machine.</summary> public static string GetHostName() { NameResolutionPal.EnsureSocketsAreInitialized(); string name = NameResolutionPal.GetHostName(); if (NetEventSource.IsEnabled) { NetEventSource.Info(null, name); } return(name); }
/// <summary>Gets the host name of the local machine.</summary> public static string GetHostName() { long startingTimestamp = NameResolutionTelemetry.Log.BeforeResolution(string.Empty); string name; try { name = NameResolutionPal.GetHostName(); } catch when(LogFailure(startingTimestamp)) { Debug.Fail("LogFailure should return false"); throw; } NameResolutionTelemetry.Log.AfterResolution(startingTimestamp, successful: true); if (NetEventSource.Log.IsEnabled()) { NetEventSource.Info(null, name); } return(name); }
} // InternalGetHostByAddress /***************************************************************************** * Function : gethostname * * Abstract: Queries the hostname from DNS * * Input Parameters: * * Returns: String ******************************************************************************/ /// <devdoc> /// <para>Gets the host name of the local machine.</para> /// </devdoc> public static string GetHostName() { GlobalLog.Print("Dns.GetHostName"); return(NameResolutionPal.GetHostName()); }